Match python args and dispatch based on their contents.
Project description
Match 'n Dispatch
Match python args and dispatch based on their contents.
Getting started
Create a dispatcher
from mnd.dispatch import Dispatcher, handle
d = Dispatcher()
Use the handy decorator
>>> @handler(d, msg="hello")
>>> def say(msg=None):
... print "got message: ", msg
Try dispatching some events
```python
>>> d.dispatch(msg="gets filtered out..."))
>>> d.dispatch(msg="hello"))
got message: hello
Install
$ pip install mnd
Match python args and dispatch based on their contents.
Getting started
Create a dispatcher
from mnd.dispatch import Dispatcher, handle
d = Dispatcher()
Use the handy decorator
>>> @handler(d, msg="hello")
>>> def say(msg=None):
... print "got message: ", msg
Try dispatching some events
```python
>>> d.dispatch(msg="gets filtered out..."))
>>> d.dispatch(msg="hello"))
got message: hello
Install
$ pip install mnd
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mnd-0.1.1.tar.gz
(3.7 kB
view hashes)