Skip to main content

spawn_blocking

Function spawn_blocking 

Source
pub fn spawn_blocking<F, T>(
    operation_name: impl Into<String>,
    work: F,
) -> Result<JoinHandle<T>, AdmissionClosed>
where F: FnOnce() -> T + Send + 'static, T: Send + 'static,
Expand description

Start blocking work with its admission lease inside the actual worker. Dropping or timing out its join waiter cannot release that lease. Work started by an admitted host task inherits its lifecycle authority; direct compatibility callers retain an independent operation scope instead.