spawn

Function spawn 

Source
pub fn spawn<T: Future + 'static>(task: T) -> JoinHandle<T::Output>
Expand description

Spawns a new asynchronous task, returning a tokio::task::JoinHandle for it.

Spawning a task enables the task to execute concurrently to other tasks. There is no guarantee that a spawned task will execute to completion. When a runtime is shutdown, all outstanding tasks are dropped, regardless of the lifecycle of that task.

This must be executed from within a runtime created by crate::start