Skip to main content

spawn_blocking_background

Function spawn_blocking_background 

Source
pub fn spawn_blocking_background<F>(
    runtime: Runtime,
    f: F,
) -> Result<(), SpawnBlockingError>
where F: FnOnce() + Send + 'static,
Expand description

Runs the given closure on a thread where blocking is acceptable.

It works similar to spawn_blocking() but doesn’t return a Future and is meant to be used for background tasks.

§Errors

See SpawnBlockingError for details.