pub struct RuntimeConfig {Show 17 fields
pub workers: usize,
pub quantum: u32,
pub mailbox: MailboxConfig,
pub max_flows: u32,
pub max_ask_waits: u32,
pub max_host_awaits: u32,
pub max_links: u32,
pub max_monitors: u32,
pub max_registry_names: u32,
pub host_await: Option<Arc<dyn HostAwaitBridge>>,
pub distribution: Option<Arc<DistributionBridge>>,
pub max_runtime_bytes: usize,
pub trust: TrustLevel,
pub paranoid_jumps: bool,
pub output: Arc<dyn OutputSink>,
pub quota: QuotaConfig,
pub jit: JitConfig,
}Expand description
Tunables for Runtime::new. Everything has a sensible default via
RuntimeConfig::default so the common case is Runtime::new(chunk).
Fields§
§workers: usizeNumber of worker OS threads. Defaults to the number of logical CPUs — one worker per core is the right starting point for a CPU-bound M:N scheduler; embedders running alongside other CPU-heavy work on the same machine may want fewer.
quantum: u32Instructions a flow runs before being preempted back to the
scheduler even if it never hits Yield.
mailbox: MailboxConfigMemory + overflow contract applied to every flow mailbox
spawned by this runtime (bytecode Spawn and host spawn).
See MailboxConfig / docs/mailbox.md.
max_flows: u32Hard cap on concurrently live flows (0 = unlimited).
Checked on every host and bytecode spawn.
max_ask_waits: u32Hard cap on outstanding Ask / AskTimeout waiters process-wide
(0 = unlimited). Each asker holds at most one wait; this bounds the
total index size when many flows park against a silent target.
See crate::docs::security (DoS) and Self::sandbox.
max_host_awaits: u32Hard cap on outstanding HostAwait parkers process-wide
(0 = unlimited). Each flow holds at most one await.
max_links: u32Hard cap on live process-wide links (0 = unlimited).
Accounting is performed by [super::link::LinkStore] itself, under
the same synchronization that protects the link table.
max_monitors: u32Hard cap on live process-wide monitors (0 = unlimited).
Accounting is performed by [super::monitor::MonitorStore] itself.
max_registry_names: u32Hard cap on live process-wide registry names (0 = unlimited).
[super::registry::RegistryStore] counts only successfully registered names.
host_await: Option<Arc<dyn HostAwaitBridge>>Host async bridge for crate::Opcode::HostAwait. None fails
any HostAwait closed. Not a CallNative / std-native slot.
distribution: Option<Arc<DistributionBridge>>Host queue for crate::Opcode::SendRemote. None fails that opcode.
Byteflow does not open sockets; the embedder drains the bridge.
max_runtime_bytes: usizeProcess-wide memory ceiling for heap charges (Str / Bytes
register stores and shared crate::HeapStr / crate::HeapBytes).
Independent of per-flow crate::QuotaConfig::mem_limit and mailbox
byte budgets. Default: 256 MiB.
trust: TrustLevelConstant-pool trust for crate::verify_with at runtime construction.
Default is crate::TrustLevel::Untrusted (fail closed).
paranoid_jumps: boolEnables defensive jump validation for every VM.
When Self::trust is crate::TrustLevel::Untrusted, paranoid
jump checking is always enabled regardless of this flag.
output: Arc<dyn OutputSink>Where bytecode print (native index 0) writes when using
crate::std_native_table_with. Ignored if you supply your own table.
quota: QuotaConfigPer-flow CPU / memory / spawn-send rate budgets.
jit: JitConfigjit only.Trace JIT settings (feature = "jit"). Ignored when the feature is off.