pub async fn fleet_stream(
__arg0: State<AppState>,
__arg1: Query<FleetFrom>,
) -> Sse<impl Stream<Item = Result<Event, Infallible>>>Expand description
GET /api/fleet/stream — replay-then-tail SSE of every stream’s events
(#219).
?from=<cursor> resumes after a cursor this endpoint issued (as the SSE
id: of each event); ?from=now skips history and tails only what happens
next — the case a notifier needs so a restart does not re-announce the past
(caliban-ai/ariel#19). Omitted means from the beginning.
The bus is only a doorbell here. Every event is read from the durable store, in cursor order, and the bus payload is discarded. The emitter appends before it publishes, so a doorbell always finds its event, and reading from the store is what makes the stream exactly-once across replicas (each replica publishes its own events; all of them are in the one store) and immune to the slow-consumer lag that the per-agent stream has to self-heal from (#28). A missed doorbell costs latency, never an event: the next one drains everything after the cursor.