Skip to main content

spawn_async

Function spawn_async 

Source
pub fn spawn_async<F, T>(future: F) -> AsyncJoinHandle<T>
where F: Future<Output = T> + Send + 'static, T: Send + 'static,
Expand description

Spawn an async future on the Tokio runtime.

The task participates in structured concurrency — the runtime waits for it before returning. Cancel via the returned handle.