Skip to main content

dispatch_background

Function dispatch_background 

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

Spawns a background task.

This function can either be called from a foreground thread or a background thread, and the future must be Send since we are using tokio as the task executor, which will possibly move tasks between threads.