Skip to main content

Lightweight, thread-safe publish-subscribe event bus

Project description

Avyra

v1.1.0 : Lightweight, thread-safe publish-subscribe event bus.

License: MIT Python Tests PyPI

pip install avyra
from enum import Enum, auto
from avyra import EventBus

class Message(Enum):
    SENT = auto()
    READ = auto()

bus = EventBus()
bus.register(Message)

@bus.on(Message.SENT)
def handler(event, payload):
    print(f"Sent: {payload}")

bus.emit(Message.SENT, "Hello!")
  • Typed events : Enum members, not strings.
  • Thread-safe : RLock-protected mutations, snapshot dispatch.
  • Zero dependencies : pure Python.

Guide → | Documentation → | Changelog → | License →

Why Avyra?

Avyra provides a lightweight event system without external dependencies, designed for applications where components need to communicate without direct coupling.

Tests

python -m pytest tests/ -v

82 tests covering subscribe, unsubscribe, emit, once, has_subscriber, clear, register, edge cases, and thread safety.

Examples

python example/chat.py
python example/downloader.py
python example/once_usage.py
python example/async_usage.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

avyra-1.1.1.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

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

avyra-1.1.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file avyra-1.1.1.tar.gz.

File metadata

  • Download URL: avyra-1.1.1.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for avyra-1.1.1.tar.gz
Algorithm Hash digest
SHA256 946082a4f86a30d898882768f549fe660311a2e3a9f262399b747110cd2267f4
MD5 1d7517278d4c3e962fe2701344486ef2
BLAKE2b-256 14c464956252885d6bda7dcfa8d07346f4e64b1ddd8691b6174e00cfdd1a8fb9

See more details on using hashes here.

File details

Details for the file avyra-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: avyra-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for avyra-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 44ff2a652038f2c1359cd713faef02694cd5e83e07a7ba627810b01863c558ee
MD5 3216d1d1e92efb43b4a77313dcc859ec
BLAKE2b-256 b45605219b4b7d0db06d3147b4544c00de8d067058f0d6a9097836d710a50fec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page