Skip to main content

handle_coder_watch

Function handle_coder_watch 

Source
pub async fn handle_coder_watch(
    req: &JsonRpcMessage,
    state: &Arc<ServerState>,
    session: &Arc<ClientSession>,
) -> Result<Value, String>
Expand description

coder.watch — the board’s one subscription.

Params: {} — or { renew: true }.

Default (renew absent or false, byte-identical to every pre-existing caller): returns the current full list AND registers the caller for coder.session_changed, atomically.

renew: true: re-registers idempotently and returns { was_registered: bool } — true if a live registration was already present, false if this call had to create one (the board had been shed or dropped, so it missed changes and should resync). It builds NO summaries, which is the point: the default path’s [summaries_for] does a whole-history disk scan, and a board renewing every 4 s forever must not pay for it.

Idempotent and re-callable. A board re-issues it on a timer to recover from a shed — the deregistration is silent by design (see [fanout_frame_to_watchers]) and the connection stays healthy, so nothing else would ever tell the board its list had stopped updating.