Function spawn

Source
pub fn spawn<T: Send + 'static>(
    future: impl Future<Output = T> + Send + 'static,
) -> JoinHandle<T> 
Expand description

Spawns a future as separate task and returns a JoinHandle which can be used to await the result. The future has access to the current TurboTasks context and runs in the same tracing span. Allocations and cpu time is accounted to the current turbo-tasks function.