Skip to main content

Module subscribe

Module subscribe 

Source
Expand description

agents logs read subscribe — first-ping-or-go-inactive wait loop.

Outer loop:

  1. Existence check (side-effect-free) per target, filtered by the optional kinds. If ANY target has a matching unread row past its watermark, call read_pending_for_parent for ALL targets (UNFILTERED — kinds gate “wake up”, not the returned slice) and emit every block. Close.
  2. Else: lock check. If no target’s instance lock (crate::command::agents::locks) is held, emit AgentsInactive and close.
  3. Else: per held-target, race wait_for_logs_message_at vs lockfile::wait_released. First fire wins. DB ping → restart from step 1 (but loop back to existence check — type-filter false positives are dropped silently). Lock release → restart from step 1.

Modules§

request_schema
response_schema

Functions§

execute