Skip to main content

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

dust_riven-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dust_riven-0.1.0-cp310-cp310-win_amd64.whl (122.9 kB view details)

Uploaded CPython 3.10Windows x86-64

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

Hashes for dust_riven-0.1.0.tar.gz
Algorithm Hash digest
SHA256 df88ab82ea5b1e82c1492f2e54b44336e39be62e655aa0c0f5222f2db8de06d3
MD5 bab9cb8b1b3715466743389f51c1834e
BLAKE2b-256 e564283851d344e7de0dfb77e606e1d712022feaede8373f87e8eb2c2ffd5129

See more details on using hashes here.

File details

Details for the file dust_riven-0.1.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for dust_riven-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 17a6b251605eeeef78b1157648b0e746941b6c221dd49f084f993b30cd2242de
MD5 9f66e91ad9e7b592a099f7b6027d8c4b
BLAKE2b-256 a73dbe4252b382ab31ebc7f5a34a4756ddf18dd6dfd1fd685685822b186ba08c

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.1

110 files

0.2.0

110 files

0.1.11

110 files

0.1.10

110 files

0.1.9

110 files

0.1.8

110 files

0.1.7

110 files

0.1.6

110 files

0.1.5

110 files

0.1.4

110 files

0.1.3

110 files

0.1.2

110 files

0.1.1

2 files

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page