Expand description
WebSocket handler and watch subscription manager.
This module provides two major components:
-
WatchManager— a thread-safe subscription registry that manages watch lifecycles (subscribe, poll, unsubscribe, add/remove IDs). Each watch tracks a set of entity IDs and the graph version at last poll, enabling efficient change detection. -
ws_handler— an Actix-Web WebSocket upgrade endpoint (GET /api/ws) that handles Haystack watch operations over JSON messages. Supports server-initiated ping/pong liveness, deflate compression for large payloads, and automatic server-push of graph changes to watching clients.
Structs§
- Watch
Manager - Manages watch subscriptions for change polling.
Functions§
- ws_
handler - WebSocket upgrade handler for
/api/ws.