Module async_util

Source
Expand description

A set of async utilities.

Modulesยง

backoff ๐Ÿ”’
condvar ๐Ÿ”’
condwait ๐Ÿ”’
select ๐Ÿ”’
sleep ๐Ÿ”’
task_group ๐Ÿ”’
timeout ๐Ÿ”’

Structsยง

Backoff
Exponential backoff https://en.wikipedia.org/wiki/Exponential_backoff
CondVar
CondVar is an async version of https://doc.rust-lang.org/std/sync/struct.Condvar.html
CondWait
CondWait is a wrapper struct for CondVar with a Mutex boolean flag.
TaskGroup
TaskGroup A group that contains spawned tasks.

Enumsยง

Either
The return value from the select function, indicating which future completed first.
TaskResult
The result of a spawned task.

Functionsยง

select
Returns the result of the future that completes first, preferring future1 if both are ready.
sleep
timeout
Waits for a future to complete or times out if it exceeds a specified duration.