Skip to main content

blocking_completing

Function blocking_completing 

Source
pub fn blocking_completing<T, E>(
    operation: &'static str,
    bugs: Arc<dyn BugSink>,
    work: impl FnOnce() -> Result<T, E> + Send + 'static,
) -> CompletingTask<Result<T, E>> ⓘ
where T: Send + 'static, E: CarriesBug + Send + 'static,
Expand description

Run work, named operation, on the blocking pool, where it runs to its end even when its caller stops waiting. Its panic comes back as TaskFailed::Panicked to a caller still waiting, and the pool dropping it unstarted as Shutdown with ShutdownOutcome::NotRun. Once no caller waits, the panic goes to bugs, as does a bug its error carries.