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::Task;
Structs
- An async executor.
- A thread-local executor.