Crate dreadnought
source ·Expand description
An asynchronous executor.
This crate is very experimental. We currently spawn an OS thread (task) per future, and use run states to wake the executor. Calling it an executor is generous. It’s merely a wrapper around a future that communicates between the waker and the task system.
The executor polls the future, passing in a waker which will unblock the current task when awoken. If the future returns pending, the executor will block the current task. When the future uses the waker, it unblocks the task, and the executor loops around, polling the future again. It will continue doing so until the future returns ready.
The crate is named after the Executor-class Start
Dreadnought (super_star_destroyer
was a bit too on the
nose).
Modules
- Asynchronous values.
- Asynchronous tasks based on Theseus’s native OS [task] subsystem.
- Utilities for tracking time.
Macros
- Pins a value on the stack.
- Polls multiple futures and streams simultaneously, executing the branch for the future that finishes first. Unlike
select!
, if multiple futures are ready, one will be selected in order of declaration. Futures directly passed toselect_biased!
must beUnpin
and implementFusedFuture
.
Traits
- An extension trait for
Future
s that provides a variety of convenient adapters.
Functions
- Executes a future to completion.