Skip to main content

handle_watch

Function handle_watch 

Source
pub async fn handle_watch(
    server: &ProtocolServer,
    req: WatchRequest,
    tx: Sender<Result<WatchEvent, Status>>,
)
Expand description

Long-running handler for the WATCH server-streaming RPC.

Subscribes to the shared [EventBus] and forwards every event to the client via the provided mpsc::Sender. The loop terminates when:

  • The client disconnects (send fails).
  • The event bus is dropped (channel closed).

Lagged receivers (slow consumers) log a warning and continue.