Skip to main content

async_runtime/
lib.rs

1#![forbid(unsafe_code)]
2#![warn(clippy::all, clippy::pedantic)]
3#![allow(clippy::module_name_repetitions, clippy::must_use_candidate)]
4
5//! A priority-aware native async runtime for the smol ecosystem.
6//!
7//! [`Runtime`] uses an `async-task` based scheduler with per-worker queues,
8//! global priority injectors, work stealing, and parking workers. [`LocalDomain`]
9//! uses `async-executor` and is driven explicitly by its host thread, allowing
10//! it to run `!Send` futures. Neither runtime owns or drives an I/O reactor.
11//!
12//! Enable the `stats` feature to inspect an approximate [`RuntimeStats`]
13//! snapshot of routing, stealing, parking, wake, and queue counters.
14
15mod error;
16mod lifecycle;
17mod local;
18mod priority;
19mod runtime;
20mod scheduler;
21#[cfg(feature = "stats")]
22mod stats;
23mod task;
24mod worker;
25
26pub use error::{ShutdownError, ShutdownOutcome, SpawnError};
27pub use local::{LocalDomain, LocalSpawner, RunStats};
28pub use priority::{Priority, PriorityWeights};
29pub use runtime::{Runtime, RuntimeBuilder, Spawner};
30#[cfg(feature = "stats")]
31pub use stats::RuntimeStats;
32pub use task::{FallibleTask, Task};