Skip to main content

Lightweight, thread-safe publish-subscribe event bus

Project description

Avyra

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

License: MIT Python Tests

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.

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

70 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

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.0.0.tar.gz (12.6 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.0.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for avyra-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2736db02d76d8c1812df40416db3ed821d69a0578356033a117ab0bfb390191d
MD5 6a4cc0628134764dae06b7154b437aa0
BLAKE2b-256 e3f7fa8681ad82ccb647f999d31d7a31496a5165f6e45e0ecbe72f05dface7ee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: avyra-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42671f1865cd3321c1bd1730478382cd317ae56bc7eab4fdb131562548d5fe45
MD5 1389deb62efd8d8adae3b5a08ee74828
BLAKE2b-256 018318621cbd540f07e7955eb0dadbe0b5489f346d8542c4c3228b24c95f69a0

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