spawn_with_abort

Function spawn_with_abort 

Source
pub fn spawn_with_abort<F>(future: F) -> AbortHandle
where F: Future<Output = ()> + Send + 'static,
Expand description

Spawn a task and return an abort handle that can be used to cancel it.

On native, this uses tokio’s abort mechanism. On WASM, the abort handle is a no-op since tasks can’t be cancelled.