Crate async_executor

Crate async_executor 

Source
Expand description

Async executors.

This crate provides two reference executors that trade performance for functionality. They should be considered reference executors that are “good enough” for most use cases. For more specialized use cases, consider writing your own executor on top of async-task.

§Examples

use async_executor::Executor;
use futures_lite::future;

// Create a new executor.
let ex = Executor::new();

// Spawn a task.
let task = ex.spawn(async {
    println!("Hello world");
});

// Run the executor until the task completes.
future::block_on(ex.run(task));

Re-exports§

pub use async_task::FallibleTask;
pub use async_task::Task;

Structs§

AsyncCallOnDrop 🔒
A wrapper around a future, running a closure when dropped.
CallOnDrop 🔒
Runs a closure when dropped.
Executor
An async executor.
LocalExecutor
A thread-local executor.
Runner 🔒
A worker in a work-stealing executor.
Sleepers 🔒
A list of sleeping tickers.
State 🔒
The state of a executor.
Ticker 🔒
Runs task one by one.

Functions§

_ensure_send_and_sync 🔒
debug_executor 🔒
Debug implementation for Executor and LocalExecutor.
debug_state 🔒
Debug implementation for Executor and LocalExecutor.
steal 🔒
Steals some items from one queue into another.