Multi-producer multi-consumer in-memory signal dispatch system
Project description
PyDispatcher Multi-producer Multi-consumer Observables
PyDispatcher provides the Python programmer with a multiple-producer-multiple-consumer signal-registration and routing infrastructure for use in multiple contexts. The mechanism of PyDispatcher started life as a highly rated recipe in the Python Cookbook. The project aims to include various enhancements to the recipe developed during use in various applications. It is primarily maintained by Mike Fletcher. A derivative of the project provides the Django web framework's "signal" system.
Installation
PyDispatcher is available on PyPI via standard PIP:
pip install PyDispatcher
Usage
Documentation is available for detailed usage, but the basic idea is:
from pydispatch import dispatcher
metaKey = "moo"
MyNode = object()
event = {"sample": "event"}
def callback(event=None):
"""Handle signal being sent"""
print("Signal received", event)
dispatcher.connect(callback, sender=MyNode, signal=metaKey)
dispatcher.send(metaKey, MyNode, event=event)
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
Hashes for PyDispatcher-2.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96543bea04115ffde08f851e1d45cacbfd1ee866ac42127d9b476dc5aefa7de0 |
|
MD5 | 79cb2d1d416666ddfe72c1228ec57e8a |
|
BLAKE2b-256 | 660e9ee7bc0b48ec45d93b302fa2d787830dca4dc454d31a237faa5815995988 |