1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! A shared, tokio-free async runtime for napi-rs addons.
//!
//! Two layers, one crate:
//!
//! - **Scheduler** (always compiled, napi-free): a pluggable async/CPU/blocking
//! scheduler with a MultiThread flavor (Rayon-backed worker pool on native
//! targets) and a CurrentThread flavor (host-driven turns; the only flavor on
//! WebAssembly). Exposed at the crate root: [`spawn`], [`spawn_blocking`],
//! [`block_on`], [`sleep_until`], [`configure`], [`start`], [`shutdown`],
//! the host driver SPIs ([`CurrentThreadTaskDriver`], [`TimerDriver`]), and
//! the metrics/introspection helpers.
//! - **napi adapter** (feature `napi`, on by default): an
//! `unsafe impl AsyncRuntime` backend for napi-rs' `async-runtime` SPI plus
//! the JavaScript-facing host protocol (`registerCurrentThreadTaskHost`,
//! `registerTimerHost`, config/metrics exports). Hosts call [`install`] from
//! their own `#[napi_derive::module_init]` hook after resolving their
//! runtime configuration; this crate deliberately ships no `module_init` of
//! its own.
/// Maximum number of physical workers a scheduler owned by this crate may
/// create.
pub const MAX_ASYNC_RUNTIME_WORKER_THREADS: usize = 256;
/// Platform-realizable worker ceiling after applying this crate's production
/// cap.
/// WebAssembly builds use the current-thread executor.
pub const
pub use *;
pub use *;