Skip to main content

spawn_blocking

Function spawn_blocking 

Source
pub fn spawn_blocking<F, R>(func: F) -> Handle<F::Output>
where F: FnOnce() -> R + Send + 'static, R: Send + 'static,
Available on crate features coroutine-heavy and coroutine only.
Expand description

Spawn a task onto the blocking pool of the background runtime

Since the light context only has one background thread, this is only enabled in heavy context to prevent misuse.