Skip to main content
Pre-release

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

Latest PyPI Version Latest PyPI Version

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)

Source distribution for PyDispatcher 3.0.0a2
File Size Uploaded
pydispatcher-3.0.0a2.tar.gz 46.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PyDispatcher 3.0.0a2
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

3.0.0a2 This release

2 release files

2.0.7

2 release files

2.0.6

1 release file

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

1 release file

2.0.1

1 release file

1.0.2

1.0.1

1.0.0

1.0.0a1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page