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Β§

Executor
An async executor.
LocalExecutor
A thread-local executor.
StaticExecutorstatic
A static-lifetimed async Executor.
StaticLocalExecutorstatic
A static async LocalExecutor created from LocalExecutor::leak.