kvarn

Function spawn

source
pub async fn spawn<T: 'static>(
    task: impl Future<Output = T> + 'static,
) -> impl Future<Output = T>
Expand description

Spawn a task.

Must be awaited once. The second await waits for the value to resolve.

Use this instead of tokio::spawn in extensions, since Kvarn’s futures can have different requirements based on the chosen features.