Python port of the extended Node.js EventEmitter2 approachproviding namespaces, wildcards and TTL.
Project description
from pymitter import EventEmitter
ee = EventEmitter()
# decorator usage
@ee.on("myevent")
def handler1(arg):
print "handler1 called with", arg
# callback usage
def handler2(arg):
print "handler2 called with", arg
ee.on("myotherevent", handler2)
# emit
ee.emit("myevent", "foo")
# -> "handler1 called with foo"
ee.emit("myotherevent", "bar")
# -> "handler2 called with bar"
Source code and more info at https://github.com/riga/pymitter.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pymitter-0.1.1.tar.gz
(3.0 kB
view details)
File details
Details for the file pymitter-0.1.1.tar.gz.
File metadata
- Download URL: pymitter-0.1.1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
462a4295c4e8e199ef1cbb30bdbb09b766c3e158a5398370cbc041722f53cd2d
|
|
| MD5 |
b52abbd17f67a8c90804278f88a4d5a2
|
|
| BLAKE2b-256 |
ff847a1b873d60df47ccbe27e191b5d8f56fe76199a1cc299d6130a2f8591145
|