pub fn spawn_blocking<F, R>(func: F) -> JoinHandle<R> ⓘAvailable on crate feature
tasks only.Expand description
Spawns a blocking closure on the current tokio runtime, like [tokio::task::spawn_blocking].
The closure is boxed first, so tokio’s blocking task machinery is instantiated once per return
type R instead of once per closure type.
§Panics
Panics if called outside of a tokio runtime context.