Skip to main content

spawn_blocking_at

Function spawn_blocking_at 

Source
pub fn spawn_blocking_at<T: Send + 'static>(
    f: impl FnOnce() -> T + Send + 'static,
    meta: SpawnMeta,
) -> JoinHandle<T> 
Expand description

Spawns a blocking task in a new thread, attributing it to meta instead of to the caller.

See Runtime::spawn_at for what meta is good for.

§Panics

This method doesn’t create runtime. It tries to obtain the current runtime by Runtime::with_current.