compio-dispatcher 0.10.0

Multithreading dispatcher for compio
Documentation

compio-dispatcher

MIT licensed crates.io docs.rs Check Test

Multithreading dispatcher for compio.

This crate provides utilities to dispatch tasks across multiple compio runtime threads, enabling parallel processing while maintaining the benefits of compio's thread-per-core model.

Usage

Use compio directly with dispatcher feature enabled:

cargo add compio --features dispatcher

Example:

use compio::dispatcher::Dispatcher;

let dispatcher = Dispatcher::builder().worker_threads(4).build().unwrap();
let result = dispatcher.dispatch(|| async {
    // Your async work here
    42
}).await;

Notice that you're dispatching a Send closure that returns Future to the other threads. The Future returned by the closure does not need to be Send, which is convenient since lots of the operations are single-thread and not Send in compio.