Module task

Module task 

Source
Expand description

Task module for spawning async tasks in WASM environment.

Structs§

JoinHandle
JoinHandle wraps a oneshot::Receiver for obtaining the task’s result, along with an AbortHandle to allow the task to be aborted.

Enums§

JoinError
Error type returned when awaiting a spawned task.

Functions§

spawn
Spawns a future as an abortable task. In WASM, spawn and spawn_local are equivalent.
spawn_blocking
Spawns a blocking task by wrapping the blocking function in an async block. In WASM this is equivalent to spawn_local since true blocking cannot be offloaded to another thread.
spawn_local
Spawns a future as an abortable task using spawn_local. This function is equivalent to tokio’s spawn_local.