Crate compio_runtime

Source
Expand description

The runtime of compio.

let ans = compio_runtime::Runtime::new().unwrap().block_on(async {
    println!("Hello world!");
    42
});
assert_eq!(ans, 42);

Modules§

eventevent
Asynchronous events.
timetime
Utilities for tracking time.

Structs§

Attacher
Attach a handle to the driver of current thread.
Runtime
The async runtime of compio. It is a thread local runtime, and cannot be sent to other threads.
RuntimeBuilder
Builder for Runtime.
Task
A spawned task.

Functions§

spawn
Spawns a new asynchronous task, returning a Task for it.
spawn_blocking
Spawns a blocking task in a new thread, and wait for it.
submit
Submit an operation to the current runtime, and return a future for it.
submit_with_flags
Submit an operation to the current runtime, and return a future for it with flags.

Type Aliases§

JoinHandle
Type alias for Task<Result<T, Box<dyn Any + Send>>>, which resolves to an Err when the spawned future panicked.