uniqc.gateway.ws module¶
WebSocket event broadcaster for the gateway dashboard.
- class uniqc.gateway.ws.Event(type, payload)[source]¶
Bases:
objectOne broadcast event.
- Parameters:
type (EventType)
payload (PAYLOAD)
- payload¶
- type¶
- class uniqc.gateway.ws.EventBroadcaster[source]¶
Bases:
objectASGI-safe singleton that fans out events to all connected WebSocket clients.
Usage:
broadcaster = EventBroadcaster() # In a route handler: await broadcaster.broadcast(Event("task:updated", {"task_id": "abc"}))
- async broadcast(event)[source]¶
Enqueue an event for fan-out to all connected clients.
- Parameters:
event (Event)
- Return type:
None