Skip to main content

spawn_completing

Function spawn_completing 

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

Run work, named operation, as its own task, so it finishes even when its caller stops waiting, as closing a store does. Its panic comes back as TaskFailed::Panicked to a caller still waiting. Once none is, the panic goes to bugs, as does a bug its error carries.