Function spawn

Source
pub fn spawn<Fut>(fut: Fut) -> TaskHandle<Fut::Output>
where Fut: Future + Send + 'static, Fut::Output: Send,
Expand description

Spawns the given Future on the task runner thread pool and returns a TaskHandle to await for the result.

Panics if the task runner hasn’t been initialized yet.