This release is a pre-release and may not be stable for production use.
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)
Scaling
Two structures keep dispatch cost proportional to the work a signal actually implies rather than to the size of the program around it.
Wiring many receivers to one sender. connect() guards against registering
the same receiver twice for a (sender, signal) pair. An index of what is
already registered answers that in constant time, so wiring N receivers to a
shared sender costs O(N) rather than O(N²). The index is an optimisation hint:
every real registration records itself there, so "not registered" is always
trustworthy, and a stale "registered" costs one scan and nothing else.
Calling a receiver. robustApply passes a receiver only the arguments it
will accept, which means knowing its parameters. Those come from the receiver's
code object, which never changes, so they are derived once and reused --
robustapply.SIGNATURE_CACHE_SIZE bounds how many are remembered. A call with
no keyword arguments needs no signature at all, since there is nothing to
subset.
Metadata
Release files for PyDispatcher 3.0.0a2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pydispatcher-3.0.0a2.tar.gz | 46.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pydispatcher-3.0.0a2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 62.2 kB
Release files / pydispatcher-3.0.0a2.tar.gz
| Download URL | pydispatcher-3.0.0a2.tar.gz |
|---|---|
| Size | 46.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
15e431a840b320ee1867ba135acf6298b1a95bd9822458f8d1a8ceb78251197e
|
|
BLAKE2b-256 checksum How to use checksums |
ab185bbb489307e0d614207ae2e177e69f41d7ca4a789fcb7a16c58894b1bf48
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.
Transparency logRelease files / pydispatcher-3.0.0a2-py3-none-any.whl
| Download URL | pydispatcher-3.0.0a2-py3-none-any.whl |
|---|---|
| Size | 15.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
af58f42d44d92ba77232e278d967575cbea69a3147617cba594c2bf5764596ee
|
|
BLAKE2b-256 checksum How to use checksums |
48baafdb36ea3f8b0b958369884f2f63216d87c39565b9792f4bf7f2eac051fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.
Transparency log