Crate single_executor

Source
Expand description

A single-threaded async executor.

Structs§

AsyncExecutor
An asynchronous executor that can be used to run multiple async tasks. All user code runs in a single thread becasue the v5 is single threaded. Blocked tasks will stop running and wait to be unblocked while also not blocking the main thread.
AsyncTask
The tasks used by AsyncExecutor.
AtomicI8State
An atomic that stores a given state in a $raw_type
AtomicI16State
An atomic that stores a given state in a $raw_type
AtomicI32State
An atomic that stores a given state in a $raw_type
AtomicI64State
An atomic that stores a given state in a $raw_type
AtomicU8State
An atomic that stores a given state in a $raw_type
AtomicU16State
An atomic that stores a given state in a $raw_type
AtomicU32State
An atomic that stores a given state in a $raw_type
AtomicU64State
An atomic that stores a given state in a $raw_type
ExecutorHandle
A handle to an executor allowing submission of tasks.
LocalExecutorHandle
A handle to an executor allowing submission of tasks. This handle may not be sent across threads but can submit !Send futures.
MultiCompleteFuture
A version of CompleteFuture that can be cloned to have multiple futures pointing to the same “complete-ness”.
MultiCompleteFutureHandle
A handle to a MultiCompleteFuture.
SleepFuture
The future given by SleepFutureRunner.
SleepFutureRunner
Runs asynchronous sleep functions by launching a separate handler thread. Each new instance of this spawns a thread.
SleepMessage
Internal message that the queue in SleepFutureRunner contains.

Functions§

polling_future
Polls a function (function) until it returns true. Sleeps between polls for sleep_duration.
spawn_blocking
Returns a future that will contain the result of function. Function will be called in another thread as to not block the main thread. Infallible version of try_spawn_blocking.
try_spawn_blocking
Returns a future that will contain the result of function. Function will be called in another thread as to not block the main thread. Fallible version of spawn_blocking.

Type Aliases§

AsyncExecutorStd
An async executor that uses std functions.