Signaling and hooking library
Project description
| Build Status | |
| Supported Versions | |
| Latest Version |
Overview
gossip is a library implementing a basic hook mechanism for implementing callbacks. It provides flexible configuration, hook namespaces and error handling strategies.
Installation
$ pip install gossip
Usage
The simplest use case when we want to register a callback to be called later. We start by registering a callback through gossip.register:
>>> from __future__ import print_function
>>> import gossip
>>> @gossip.register('hook_name')
... def func():
... print('Called')
Now we can call the hook:
>>> gossip.trigger('hook_name')
Called
And There's A Lot More!
Plain publish/subscribe is just the tip of the iceberg. Gossip is geared towards implementing complex plugin systems, and supports many more advanced features, such as:
- Token (bulk) unregistration of hooks
- Hook dependencies - control the order of hook callbacks, either implicitly or explicitly
- Non-reentrant hooks
- Custom exception handling strategies
And much more. For more information, please refer to the documentation
Licence
BSD3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gossip-2.5.0.tar.gz.
File metadata
- Download URL: gossip-2.5.0.tar.gz
- Upload date:
- Size: 64.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0d2338f49f2c1445a7e463076b208464590c90cb5b576bf242d59b705c8d09e
|
|
| MD5 |
3cb734f77f34dc88d1cecf9ffa742ac0
|
|
| BLAKE2b-256 |
2c4c86dc8fb75aec9d84456ef7ba2d3307411f5efebed07081c279c9e2659b94
|
File details
Details for the file gossip-2.5.0-py3-none-any.whl.
File metadata
- Download URL: gossip-2.5.0-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e5a1c82ab797126558e9f2709e671029f31a620550da25201a6867425db4108
|
|
| MD5 |
fe1a94f29443f4a9ace21a9aaec2fd18
|
|
| BLAKE2b-256 |
d6c4429565ca5febe2497396fff0b9b829cc7db42ffe06a301868249a13ef3d5
|