Skip to main content

Signaling and hooking library

Project description

Build Status Build Status
Supported Versions Supported Versions
Latest Version 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:

  1. Token (bulk) unregistration of hooks
  2. Hook dependencies - control the order of hook callbacks, either implicitly or explicitly
  3. Non-reentrant hooks
  4. Custom exception handling strategies

And much more. For more information, please refer to the documentation

Licence

BSD3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gossip-2.5.0.tar.gz (64.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gossip-2.5.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

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

Hashes for gossip-2.5.0.tar.gz
Algorithm Hash digest
SHA256 f0d2338f49f2c1445a7e463076b208464590c90cb5b576bf242d59b705c8d09e
MD5 3cb734f77f34dc88d1cecf9ffa742ac0
BLAKE2b-256 2c4c86dc8fb75aec9d84456ef7ba2d3307411f5efebed07081c279c9e2659b94

See more details on using hashes here.

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

Hashes for gossip-2.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e5a1c82ab797126558e9f2709e671029f31a620550da25201a6867425db4108
MD5 fe1a94f29443f4a9ace21a9aaec2fd18
BLAKE2b-256 d6c4429565ca5febe2497396fff0b9b829cc7db42ffe06a301868249a13ef3d5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page