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

Download history 4082/week @ 2025-11-17 3704/week @ 2025-11-24 4801/week @ 2025-12-01 6397/week @ 2025-12-08 9262/week @ 2025-12-15 5644/week @ 2025-12-22 5010/week @ 2025-12-29 3558/week @ 2026-01-05 4308/week @ 2026-01-12 3538/week @ 2026-01-19 4399/week @ 2026-01-26 5398/week @ 2026-02-02 4259/week @ 2026-02-09 5139/week @ 2026-02-16 5623/week @ 2026-02-23 6435/week @ 2026-03-02

21,840 downloads per month
Used in 70 crates (18 directly)

MIT license

450KB
11K SLoC


compio-runtime

MIT licensed crates.io docs.rs Check Test

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