dust-riven
A fast, thread-safe Signal (observer/pub-sub) primitive for Python, implemented in Rust with PyO3.
Inspired by blinker, dust-riven aims to be a drop-in-style, lightweight alternative with significantly faster connect/emit performance.
Install
pip install dust-riven
Usage
from dust_riven import Signal
signal = Signal()
def on_event(*args):
print("received:", args)
handle = signal.connect(on_event)
signal.emit(1, 2, 3) # -> received: (1, 2, 3)
signal.disconnect(handle)
API
Signal()- create a new signal.signal.connect(callback) -> int- register a callback, returns a handle.signal.disconnect(handle)- remove a previously connected callback.signal.emit(*args)- call all connected listeners with*args.
Benchmark
A comparison script against blinker is available in bench/benchmark.py:
pip install blinker
python bench/benchmark.py
Development
Built with maturin:
maturin develop
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dust_riven-0.1.0.tar.gz.
File metadata
- Download URL: dust_riven-0.1.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df88ab82ea5b1e82c1492f2e54b44336e39be62e655aa0c0f5222f2db8de06d3
|
|
| MD5 |
bab9cb8b1b3715466743389f51c1834e
|
|
| BLAKE2b-256 |
e564283851d344e7de0dfb77e606e1d712022feaede8373f87e8eb2c2ffd5129
|
File details
Details for the file dust_riven-0.1.0-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: dust_riven-0.1.0-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 122.9 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17a6b251605eeeef78b1157648b0e746941b6c221dd49f084f993b30cd2242de
|
|
| MD5 |
9f66e91ad9e7b592a099f7b6027d8c4b
|
|
| BLAKE2b-256 |
a73dbe4252b382ab31ebc7f5a34a4756ddf18dd6dfd1fd685685822b186ba08c
|