pyd
PyDispatcher
pypi i PyDispatcher
pyd

PyDispatcher

Observable signal implementation for python

by Mike C. Fletcher

2.0.6 (see all)License:BSD
pypi i PyDispatcher
Readme

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)

GitHub Stars

4

LAST COMMIT

3mos ago

MAINTAINERS

1

CONTRIBUTORS

1

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
2.0.6
3mos ago
2.0.5
8yrs ago
2.0.4
8yrs ago
2.0.3
11yrs ago
No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate