An eventbus that used for FinanGen
Project description
eventbus-py
EventBus的Python实现
Example
- 调用规范
由于设计时考虑到可能会存在多个实例的情况,故使用ContextVar来包装EventBus实例方便使用者调用。
from eventbus import bus, Subscribe class Example: pass class A: def __init__(self): bus.get().register(a) @Subscribe(priority=100, sticky=True) def on_example(self, event: Example): bus.get().cancel_delivery(event) bus.get().unregister(a) a = A() bus.get().post(a)
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
eventbus-py-0.0.3.tar.gz
(7.5 kB
view hashes)
Built Distributions
eventbus_py-0.0.3-py3.8.egg
(17.3 kB
view hashes)
Close
Hashes for eventbus_py-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d8d5126fdae49ca27e7e888567ce9d86f0b355c5783a3206c263dbcfbd37288 |
|
MD5 | 79f33fba13c3bb435eab90286a8cd54d |
|
BLAKE2b-256 | 3f090e3294076e672621e5f509e70fc94239daf1228735099adb797101f94cb2 |