Reference

EventStream from which eventipy.events is created

class eventipy.event_stream.EventStream
get_by_id(event_id: uuid.UUID) Optional[eventipy.event.Event]
Parameters

event_id (UUID) – The id of the wanted event

get_by_topic(topic: str, max_events: Optional[int] = None) List[eventipy.event.Event]
Parameters
  • topic (str) – The topic to which the event was published

  • max_events (int) – The maximum number of events to retrieve

async publish(event: eventipy.event.Event) None
Parameters

event (Event) – The event to publish

subscribe(topic: str, event_handler: Optional[Callable[[eventipy.event.Event], Union[Any, Awaitable[Any]]]] = None) Callable
Parameters
  • topic (str) – The topic to which this handler listens

  • event_handler (Callable[[Event], None]) – Optional handler to give to avoid using decorator

subscribe_to_all(event_handler: Optional[Callable[[eventipy.event.Event], Union[Any, Awaitable[Any]]]] = None)
class eventipy.Event(*, topic: str = '', id: uuid.UUID = None, created_at: datetime.datetime = None)
class Config
allow_mutation = False
created_at: datetime.datetime
id: uuid.UUID
topic: str