Skip to main content

spawn_owned

Function spawn_owned 

Source
pub fn spawn_owned<E, F>(
    operation: &'static str,
    bugs: BugSinkRef,
    work: impl Future<Output = ()> + Send + 'static,
    ended: E,
) -> OwnedTask
where E: FnOnce(Bug) -> F + Send + 'static, F: Future<Output = ()> + Send,
Expand description

Run work, named operation, as its own task that nobody waits for: a worker its owner stops. A panic in it goes to bugs, then ended runs, so the owner ends what the work served in a way its readers see, such as recording that sync failed. A panic in ended goes to bugs too, and no further.