pub struct RuntimeOptions {
pub flavor: RuntimeFlavor,
pub worker_threads: usize,
pub max_blocking_tasks: usize,
pub thread_name_prefix: String,
pub park_deadline: Option<Duration>,
pub drain_linger: Duration,
}Fields§
§flavor: RuntimeFlavor§worker_threads: usize§max_blocking_tasks: usize§thread_name_prefix: String§park_deadline: Option<Duration>Deadline-based block_on deadlock detection: bounds how long a
runtime-owned park (the CurrentThread block_on parker and
MultiThread COOPERATIVE driver parks – never the foreign/napi
whole-build park) may sleep with ZERO runtime progress before
panicking with the typed BlockOnDeadlock diagnostic. None (the
default) disables deadline detection: a legitimately long park (e.g.
awaiting a slow JS plugin) must never panic a production build. The
runtime itself never reads the environment; the embedder resolves its
own configuration (conventionally a PARK_DEADLINE_ENV-style
variable) into this field at addon load. The
threadless-wasm CERTAIN deadlock check is independent of this knob and
always on.
drain_linger: DurationMultiThread drainer idle-linger budget (see MultiThreadExecutor::drain):
after running the runnable/blocking queues empty a drainer parks on its
own parker for up to this long before returning its thread to rayon, so
a wave landing within the budget resumes it with one targeted wake
instead of a spawn_fifo respawn through rayon’s idle protocol.
Duration::ZERO disables lingering (legacy exit-and-respawn on every
empty queue). Validation clamps the budget to
MAX_DRAIN_LINGER_MICROS: a linger occupies a pool worker and an
active_drainers slot while idle, so an unbounded value would pin
workers indefinitely. As with park_deadline, the runtime itself never
reads the environment; the embedder resolves its configuration
(conventionally DRAIN_LINGER_ENV, which the napi adapter’s install
resolves for hosts that use it) into this field at addon load. Ignored
by the CurrentThread flavor, which has no pool drainers.
Trait Implementations§
Source§impl Clone for RuntimeOptions
impl Clone for RuntimeOptions
Source§fn clone(&self) -> RuntimeOptions
fn clone(&self) -> RuntimeOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RuntimeOptions
impl Debug for RuntimeOptions
Source§impl Default for RuntimeOptions
impl Default for RuntimeOptions
Source§impl From<RuntimeOptions> for BindingRuntimeConfig
impl From<RuntimeOptions> for BindingRuntimeConfig
Source§fn from(value: RuntimeOptions) -> Self
fn from(value: RuntimeOptions) -> Self
Auto Trait Implementations§
impl Freeze for RuntimeOptions
impl RefUnwindSafe for RuntimeOptions
impl Send for RuntimeOptions
impl Sync for RuntimeOptions
impl Unpin for RuntimeOptions
impl UnsafeUnpin for RuntimeOptions
impl UnwindSafe for RuntimeOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more