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.2.tar.gz
(6.5 kB
view hashes)
Built Distributions
eventbus_py-0.0.2-py3.8.egg
(17.3 kB
view hashes)
Close
Hashes for eventbus_py-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d68453a1ae495ea490279dd497012ec1922bdf26333da106523b85647d2d77f |
|
MD5 | 9caeee0fae815f2a44af9883d6763559 |
|
BLAKE2b-256 | 15503265bda06df66acba4f5e183624cadf0fe72f84d579d9a465823b5019d64 |