run_stream_flusher

Function run_stream_flusher 

Source
pub async fn run_stream_flusher(
    rx: Receiver<StreamRecord>,
    targets: Receiver<StreamTargets>,
    obs: Arc<Observability>,
    shutdown: Receiver<()>,
)
Expand description

The flusher loop (DW-121): drain the stream channel, assemble ordered batches, and deliver each batch — inline, in order, one retry cycle per batch — to the current generation’s sinks. Stops on shutdown after draining what is already queued into one final flush attempt (the gateway is not a durable queue; an offer undelivered at process death is lost with its counters as the witness).

Spawned by the dataplane (DataPlane::spawn_record_stream_flusher) so the binary and tests share one wiring path.