Library installation¶
$ pip install eventipy
Getting Started¶
Publishing an event:
import asyncio
from eventipy import events, Event
event = Event(topic="my-topic")
asyncio.run(events.publish(event))
Subscribing to a topic:
from eventipy import events
@events.subscribe("my-topic")
async def event_handler(event: Event):
print(event.id)
print(event.topic)
Dependencies¶
dataclasses (for python 3.6 compatability)