runite 0.1.0

An event-loop-per-thread async runtime built on io_uring (Linux), kqueue (macOS), and IOCP (Windows)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Linux channel wake helpers.

use crate::op::completion::{CompletionFuture, CompletionHandle, WakeClass, completion};
use crate::platform::current::runtime::try_current_thread_handle;

pub(crate) fn runtime_waiter<T: Send + 'static>() -> (CompletionFuture<T>, CompletionHandle<T>) {
    let owner = try_current_thread_handle()
        .expect("async channel operations must be polled on a runtime thread");
    // Channel resolutions are in-process events: same-thread wakes join the
    // current microtask checkpoint (the `Promise.resolve` analog), unlike I/O
    // completions which always take a macro turn.
    completion(owner, WakeClass::Microtask)
}