Available on crate feature task only.
Expand description

Tokio task utilities.

Named task spawning

The spawn and spawn_blocking methods are wrappers around tokio::task::spawn and tokio::task::spawn_blocking that attach a name the spawned task.

If Clippy sent you here, replace:



mz_ore::task::spawn(|| format!("taskname:{}", info), my_future)
mz_ore::task::spawn_blocking(|| format!("name:{}", info), my_blocking_closure)

If you are using methods of the same names on a Runtime or Handle, import RuntimeExt and replace spawn with RuntimeExt::spawn_named and spawn_blocking with RuntimeExt::spawn_blocking_named, adding naming closures like above.


Wraps a JoinHandle to abort the underlying task when dropped.


Extension methods for JoinHandle.
Extension methods for Runtime and Handle.


Spawns a new asynchronous task with a name.
Runs the provided closure with a name on a thread where blocking is acceptable.