Skip to main content

Module future

Module future 

Source
Expand description

Shuttle’s implementation of an async executor, roughly equivalent to futures::executor.

The spawn method spawns a new asynchronous task that the executor will run to completion. The block_on method blocks the current thread on the completion of a future.

Modules§

batch_semaphore
A counting semaphore supporting both async and sync operations.

Structs§

AbortHandle
An owned permission to abort a spawned task, without awaiting its completion.
JoinHandle
An owned permission to join on an async task (await its termination).

Enums§

JoinError
Task failed to execute to completion.

Functions§

block_on
Run a future to completion on the current thread.
spawn
Spawn a new async task that the executor will run to completion.
spawn_local
Spawn a new async task that the executor will run to completion. This is just spawn without the Send bound, and it mirrors spawn_local from Tokio.
yield_now
Yields execution back to the scheduler.