Skip to main content

A simple python event bus for python3

Project description

async-event-bus

A simple event bus for python3


ReleaseCardReleaseDataCard
LastCommitCardProjectLanguageCardProjectLicense

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.4.0.tar.gz (9.4 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.4.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: async_event_bus-0.4.0.tar.gz
  • Upload date:
  • Size: 9.4 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.4.0.tar.gz
Algorithm Hash digest
SHA256 44c04d36cca5102d43a2406e8fa3f20aa60d940916e5daa7b18039284c3718d5
MD5 0c498c4385a0a361c613ec1b61dde4fd
BLAKE2b-256 60aec59bfd9f2720e4b7f3729d37b286ff47a9775609add9c3a6c273fe78dd1d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: async_event_bus-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5a4a386eff615a1a2d450f320d1c698af5625612093e930a1489d79a45e25d7
MD5 7d656f66c9dc5f69fb00f229c7f83b0a
BLAKE2b-256 b889d0028625ce65dcfeb72abd0fe5794ffe959d317b46f6f26d4d366a9463d8

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