Skip to main content

RuntimeConfig

Struct RuntimeConfig 

Source
pub struct RuntimeConfig {
Show 22 fields pub worker_threads: usize, pub thread_stack_size: usize, pub thread_name_prefix: String, pub global_queue_limit: usize, pub steal_batch_size: usize, pub blocking: BlockingPoolConfig, pub enable_parking: bool, pub poll_budget: u32, pub cancel_lane_max_streak: usize, pub logical_clock_mode: Option<LogicalClockMode>, pub root_region_limits: Option<RegionLimits>, pub on_thread_start: Option<Arc<dyn Fn() + Send + Sync>>, pub on_thread_stop: Option<Arc<dyn Fn() + Send + Sync>>, pub deadline_monitor: Option<MonitorConfig>, pub deadline_warning_handler: Option<Arc<dyn Fn(DeadlineWarning) + Send + Sync>>, pub metrics_provider: Arc<dyn MetricsProvider>, pub observability: Option<ObservabilityConfig>, pub cancel_attribution: CancelAttributionConfig, pub obligation_leak_response: ObligationLeakResponse, pub leak_escalation: Option<LeakEscalation>, pub enable_governor: bool, pub governor_interval: u32,
}
Expand description

Runtime configuration.

Fields§

§worker_threads: usize

Number of worker threads (default: available parallelism).

§thread_stack_size: usize

Stack size per worker thread (default: 2MB).

§thread_name_prefix: String

Name prefix for worker threads.

§global_queue_limit: usize

Global queue size limit (0 = unbounded).

§steal_batch_size: usize

Work stealing batch size.

§blocking: BlockingPoolConfig

Blocking pool configuration.

§enable_parking: bool

Enable parking for idle workers.

§poll_budget: u32

Time slice for cooperative yielding (polls).

§cancel_lane_max_streak: usize

Maximum consecutive cancel-lane dispatches before yielding to other lanes.

§logical_clock_mode: Option<LogicalClockMode>

Logical clock mode used for trace causal ordering.

When None, the runtime chooses a default:

  • No reactor: Lamport (deterministic lab-friendly)
  • With reactor: Hybrid (wall-clock + logical)
§root_region_limits: Option<RegionLimits>

Admission limits applied to the root region (if set).

§on_thread_start: Option<Arc<dyn Fn() + Send + Sync>>

Callback executed when a worker thread starts.

§on_thread_stop: Option<Arc<dyn Fn() + Send + Sync>>

Callback executed when a worker thread stops.

§deadline_monitor: Option<MonitorConfig>

Deadline monitoring configuration (when enabled).

§deadline_warning_handler: Option<Arc<dyn Fn(DeadlineWarning) + Send + Sync>>

Warning callback for deadline monitoring.

§metrics_provider: Arc<dyn MetricsProvider>

Metrics provider for runtime instrumentation.

§observability: Option<ObservabilityConfig>

Optional runtime observability configuration.

§cancel_attribution: CancelAttributionConfig

Limits for cancellation attribution cause chains.

Used to bound memory growth when cancellation cascades across deep region trees or large cancellation graphs.

§obligation_leak_response: ObligationLeakResponse

Response policy for obligation leaks detected at runtime.

§leak_escalation: Option<LeakEscalation>

Optional escalation policy for obligation leaks.

When set, the runtime escalates from obligation_leak_response to escalation.escalate_to after escalation.threshold leaks.

§enable_governor: bool

Enable the Lyapunov governor for scheduling suggestions.

When enabled, the scheduler periodically snapshots runtime state and consults the governor for lane-ordering hints. When disabled (default), scheduling behavior is identical to the ungoverned baseline.

§governor_interval: u32

Number of scheduling steps between governor snapshots (default: 32).

Lower values increase responsiveness but add snapshot overhead. Only relevant when enable_governor is true.

Implementations§

Source§

impl RuntimeConfig

Source

pub fn normalize(&mut self)

Normalize configuration values to safe defaults.

Trait Implementations§

Source§

impl Clone for RuntimeConfig

Source§

fn clone(&self) -> RuntimeConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for RuntimeConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, _span: NoopSpan) -> Self

Instruments this future with a span (no-op when disabled).
Source§

fn in_current_span(self) -> Self

Instruments this future with the current span (no-op when disabled).
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more