Function spawn

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

Spawn a potentially instrumented task.

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