Gateway
Table of Contents
Section titled “Table of Contents”syncopate.gateway
Section titled “syncopate.gateway”SSE gateway client for real-time events.
Gateway Objects
Section titled “Gateway Objects”class Gateway()SSE gateway client.
Connects to /api/events and dispatches parsed events to handlers.
Handles reconnection with exponential backoff and Last-Event-ID replay.
def on(event: str, handler: Callable[..., Awaitable[None]]) -> NoneRegister a handler for a specific event type.
connect
Section titled “connect”async def connect() -> NoneConnect to the SSE stream and start dispatching events.
disconnect
Section titled “disconnect”async def disconnect() -> NoneDisconnect from the SSE stream.