Skip to content

Latest commit

 

History

History
37 lines (29 loc) · 1.34 KB

File metadata and controls

37 lines (29 loc) · 1.34 KB

compio-compat

MIT licensed crates.io docs.rs Check Test

Run compio in other async runtimes.

Usage

Use compio::compat re-exported from compio crate.

use compio::compat::{RuntimeCompat, TokioAdapter};

#[tokio::main]
async fn main() {
    // Create a compio runtime:
    let runtime = compio::runtime::Runtime::new().unwrap();
    // Create the compat layer:
    let runtime = RuntimeCompat::<TokioAdapter>::new(runtime).unwrap();
    // Execute your future:
    runtime.execute(async {
        // Run compio-specific code
    }).await;
}