Skip to main content

A simple python event bus for python3

Project description

py-event-bus

A simple event bus for python3

GitHub release GitHub commits since latest release GitHub top language GPLv3

Quick Start

  1. install package with pip or any tools you like
pip install async-event-bus
  1. use example code under
import asyncio
import sys

from loguru import logger

from async_event_bus import EventBus

bus = EventBus()
logger.remove()
logger.add(sys.stdout, level="TRACE")


@bus.on("message")
async def message_handler(message: str, *args, **kwargs) -> None:
    logger.info(f"message received: {message}")


async def main():
    await asyncio.gather(
        bus.emit("message", "Hello"),
        bus.emit("message", "This is a test message"),
        bus.emit("message", "Send from python"),
        bus.emit("message", "This is also a test message")
    )


if __name__ == "__main__":
    loop = asyncio.new_event_loop()
    loop.run_until_complete(main())
  1. Check out the examples under the 'examples' folder for more help

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

async_event_bus-0.3.0.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

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

async_event_bus-0.3.0-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

Details for the file async_event_bus-0.3.0.tar.gz.

File metadata

  • Download URL: async_event_bus-0.3.0.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.25.5 CPython/3.10.7 Windows/10

File hashes

Hashes for async_event_bus-0.3.0.tar.gz
Algorithm Hash digest
SHA256 67bbbc1822ab84f30102dc9b2592c81ccb7a9ab8070ebc5459513d9092e3486f
MD5 43d5d94234c979a32aac0c098af57d4a
BLAKE2b-256 49b8457fc6b1532d2e51b72e882b345579f9fe47834cba75721c79d151d7962e

See more details on using hashes here.

File details

Details for the file async_event_bus-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: async_event_bus-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 24.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.25.5 CPython/3.10.7 Windows/10

File hashes

Hashes for async_event_bus-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae59ea583578f3f5dbbb9e5bfa8f41619acaf501d3b654185c6f22ee0fb2f7aa
MD5 6ab6b8ac52ced53152aa1b258c8e4fc2
BLAKE2b-256 68811bf4197205a332e05ae0e37f39e2e4194b46e3755c8d40a1757b8f13ce95

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