Skip to main content

Module task

Module task 

Source
Expand description

Async task primitives: spawning concurrent tasks and yielding to the scheduler.

Structs§

Cancelled
Error returned by JoinHandle when the task’s result was not collected before being dropped.
JoinHandle
Handle to a spawned task. Awaiting it returns the task’s output, or Cancelled if the handle was dropped before the task completed.

Functions§

spawn
Spawns fut as a concurrent task, returning a JoinHandle to collect its result.
yield_now
Yields control back to the runtime for one tick, allowing other tasks and I/O completions to be processed before this task resumes.