Skip to main content

pump_diagnostics

Function pump_diagnostics 

Source
pub async fn pump_diagnostics(
    layer: DiagnosticsLayer,
    rx: Receiver<DiagnosticEvent>,
)
Expand description

Drain a DiagnosticEvent broadcast receiver into the layer in a tokio task. Returns when the bus closes (the server is gone). Lagging consumers (Lagged(n)) are tolerated – the next event in the queue still reflects the latest state per URI, which is what callers care about.

Spawn pattern:

ⓘ
let layer = DiagnosticsLayer::new(logger.clone());
let rx = server_handle.subscribe_diagnostics();
tokio::spawn(pump_diagnostics(layer.clone(), rx));