Skip to main content

A simple python event bus for python3

Project description

py-event-bus

A simple event bus for python3

Quick Start

  1. install package with pip or any tools you like
pip install py-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.publish("message", "Hello"),
        bus.publish("message", "This is a test message"),
        bus.publish("message", "Send from python"),
        bus.publish("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.1.0.tar.gz (20.5 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.1.0-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for async_event_bus-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ebf8c9210372e7e9fdf8e17dbf78fe214533b5f9226bcd89416f99ffc0a3f292
MD5 82f15c7967a2f9195ff4aa7db56a4311
BLAKE2b-256 349fad1d8d1c6eaa95df39066edde39406891770707a4b09f81d6f575ea539ec

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for async_event_bus-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9840102b4d95bf5f0a2e7cc482d4c98a98547a0a802fd3807ed28ff8bf73b5f1
MD5 a23fbe6f886697165bcff89549a706ab
BLAKE2b-256 e0e37afa4e5e5de6f8d671337d8fbff80bbd3e70da15687233c57040ba1a1a34

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