Function spawn_with_killswitch

Source
pub fn spawn_with_killswitch<M, T>(name: &str, metrics: M, future: T)
where T: Future<Output = ()> + Send + 'static, M: Metrics,
Expand description

Spawn a potentially instrumented, long-lived task. Integrates with task-killswitch.

Depending on whether the tokio-task-metrics feature is enabled, this may instrument the task and collect metrics for it.