spawn_wait

Function spawn_wait 

Source
pub fn spawn_wait<F>(task: F)
where F: FnOnce() + Send + 'static,
Expand description

Fire and forget a wait task. The task starts executing immediately.

§Panic Handling

If the task panics the panic message is logged as an error, and can observed using set_spawn_panic_handler. It is otherwise ignored.

§Unwind Safety

This function disables the unwind safety validation, meaning that in case of a panic shared data can end-up in an invalid (still memory safe) state. If you are worried about that only use poisoning mutexes or atomics to mutate shared data or use wait_catch to detect a panic or wait to propagate a panic.