22 releases (10 breaking)
Uses new Rust 2024
| 0.11.0 | Jan 29, 2026 |
|---|---|
| 0.10.1 | Dec 1, 2025 |
| 0.9.5 | Nov 17, 2025 |
| 0.8.1 | Jun 29, 2025 |
| 0.2.0-beta.2 | Nov 18, 2023 |
#1045 in Asynchronous
21,840 downloads per month
Used in 70 crates
(18 directly)
450KB
11K
SLoC
compio-runtime
High-level runtime for compio.
This crate provides the async runtime (executor) that coordinates task execution with the low-level driver (proactor). It implements a thread-per-core model.
Usage
The recommended way is to use main macro with compio's macros feature, but you can also use the runtime directly by enabling the runtime feature:
cargo add compio --features runtime
Example:
use compio::runtime::Runtime;
let runtime = Runtime::new().unwrap();
runtime.block_on(async {
// Your async code here
});
Configuration
The runtime can be configured using the RuntimeBuilder:
use compio::runtime::RuntimeBuilder;
use compio::driver::ProactorBuilder;
let mut proactor = ProactorBuilder::new();
// Configure proactor here, e.g.
proactor.capacity(1024);
let runtime = RuntimeBuilder::new()
.with_proactor(proactor)
// Configure other options here
.build()
.unwrap();
runtime.block_on(async {
// Your async code here
});
Dependencies
~6–17MB
~253K SLoC