Skip to main content

serve

Function serve 

Source
pub async fn serve(
    listener: Listener,
    stats: Arc<RwLock<MonitordStats>>,
    state: Arc<Mutex<ReportState>>,
) -> Result<()>
Expand description

Serve io.systemd.Metrics on listener until an error ends it.

The future is not Send (a zlink limitation, rust-lang/rust#100013), so it can’t go to tokio::spawn on a multi-threaded runtime. Run it with tokio::select!, on a LocalSet, or use spawn_server.