1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
Metadata-Version: 2.1
Name: PyDispatcher
Version: 2.0.7
Summary: Multi-producer multi-consumer in-memory signal dispatch system
Home-page: https://github.com/mcfletch/pydispatcher
Download-URL: https://pypi.org/project/pydispatcher/
Author: Patrick K. O'Brien
Maintainer: Mike C. Fletcher
Maintainer-email: "Mike C. Fletcher" <mcfletch@vrplumber.com>
License: BSD
Keywords: dispatcher,dispatch,pydispatch,event,signal,sender,receiver,propagate,multi-consumer,multi-producer,saferef,robustapply,apply
Platform: Any
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Intended Audience :: Developers
Description-Content-Type: text/markdown
Provides-Extra: dev
# 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](http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/87056)
in the [Python Cookbook](http://aspn.activestate.com/ASPN/Python/Cookbook/). The [project](https://github.com/mcfletch/pydispatcher) aims
to include various enhancements to the recipe developed during use in
various applications. It is primarily maintained by [Mike Fletcher](http://www.vrplumber.com). 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
```
[](https://pypi.python.org/pypi/pydispatcher)
[](https://pypi.python.org/pypi/pydispatcher)
## Usage
[Documentation](https://mcfletch.github.io/pydispatcher/) 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)
```
|