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.1.tar.gz
(6.8 kB
view hashes)
Built Distribution
Close
Hashes for eventbus_py-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81d81965f936d59f7cf6ee0d4a8186391d531ab294f0af3c65494ef5fbea0359 |
|
MD5 | 896bcb20895113107269a0defd1d4171 |
|
BLAKE2b-256 | 6252402c6839eb3e531d4bf3e80e2408878858862df9ce64bc5c4dff54fc2a50 |