Struct Config
pub struct Config {Show 23 fields
pub dir: PathBuf,
pub durability: Durability,
pub shards: Option<u32>,
pub local: LocalOptions,
pub retention: Duration,
pub park_after: Duration,
pub memory_budget: u64,
pub checkpoint_interval: Duration,
pub checkpoint_on_shutdown: bool,
pub shared_log: bool,
pub max_loaded_per_shard: usize,
pub inline_flush: bool,
pub inline_flush_max: Duration,
pub queue: usize,
pub keep_history: bool,
pub on_exhausted: Exhausted,
pub archive_history: bool,
pub codec: Option<Arc<dyn Codec>>,
pub limits: Option<Arc<dyn LimitBackend>>,
pub backup: Option<BackupConfig>,
pub payload_offload_bytes: u64,
pub profile: Option<Profile>,
pub http: Option<String>,
/* private fields */
}Fields§
§dir: PathBuf§durability: Durability§shards: Option<u32>Number of shards (threads, logs). Fixed for a data directory.
local: LocalOptions§retention: Duration§park_after: DurationThe longest a suspended run stays loaded (its code and journal in
memory); Duration::MAX never parks.
memory_budget: u64Bytes loaded runs may take across all shards (an estimate). Above
it, each shard parks the runs suspended longest before
park_after. 0: no budget.
checkpoint_interval: Duration§checkpoint_on_shutdown: boolCheckpoint each shard on Engine::shutdown, so the next open
replays nothing and covered log segments are deleted.
New local directories use log format 3: one log shared by every
shard ([crate::wal]). Existing directories keep the format they
were created with.
max_loaded_per_shard: usize§inline_flush: bool§inline_flush_max: DurationA shard flushes inline only while the last flush took at most this long (on a slower disk, blocking the shard thread would delay new work by a whole flush).
queue: usizeBounded command queue per shard; a full queue makes calls Busy.
keep_history: boolKeep finished runs’ whole journals (for audit, inspect, export
and reset of finished runs).
on_exhausted: ExhaustedWhat a step does when its retries run out, unless its retry policy
says (crate::Exhausted; default: fail).
archive_history: boolArchive complete terminal journals beyond hot retention.
codec: Option<Arc<dyn Codec>>Payload encryption, applied before payloads become records.
limits: Option<Arc<dyn LimitBackend>>Where step limits live; None keeps them in this process.
backup: Option<BackupConfig>Continuous backup to object storage (crate::backup).
payload_offload_bytes: u64A record whose encoding is longer than this many bytes (a large step
result, signal, update, start input or stream chunk) is written to
the shared log’s blob area, in parallel with the log, instead of
into a log batch, so it does not delay other shards’ records
(docs/durability.md, “Large payloads”). 0: never. Local directories
in log format 3 only: memory mode ignores it and server and
replicated mode refuse a nonzero value.
profile: Option<Profile>Production, or Dev for development (crate::dev). None reads
FUSEE_PROFILE when the engine opens; it is never inferred.
http: Option<String>Serve the HTTP API and the web UI here once open. Under the dev
profile, None means FUSEE_HTTP, else 127.0.0.1:7601, else a
free port; off serves nothing.
Implementations§
§impl Config
impl Config
pub fn memory() -> Self
pub fn memory() -> Self
memory durability: nothing is written.
pub fn payload_offload_bytes(self, bytes: u64) -> Self
pub fn payload_offload_bytes(self, bytes: u64) -> Self
See Config::payload_offload_bytes; 0 turns offload off.
pub fn shards(self, n: u32) -> Self
pub fn retention(self, d: Duration) -> Self
pub fn park_after(self, d: Duration) -> Self
pub fn memory_budget(self, bytes: u64) -> Self
pub fn checkpoint_on_shutdown(self, on: bool) -> Self
pub fn checkpoint_interval(self, d: Duration) -> Self
pub fn segment_bytes(self, n: u64) -> Self
pub fn local_options(self, o: LocalOptions) -> Self
pub fn keep_history(self, on: bool) -> Self
pub fn on_exhausted(self, then: Exhausted) -> Self
pub fn on_exhausted(self, then: Exhausted) -> Self
What a step does when its retries run out, for every step whose
retry policy does not say (crate::Exhausted::Pause: the run
waits for RunHandle::resume).
pub fn profile(self, p: Profile) -> Self
pub fn profile(self, p: Profile) -> Self
See crate::dev. Without it, FUSEE_PROFILE decides.
pub fn dev(self) -> Self
pub fn dev(self) -> Self
The dev profile (crate::dev): every run’s history kept, each run
replayed against the code when it waits or ends, the UI served.
pub fn http(self, addr: impl Into<String>) -> Self
pub fn http(self, addr: impl Into<String>) -> Self
Serves the HTTP API and the web UI at addr (loopback; for a token
or another interface use crate::http::serve).
Engine::http_url gives the address.
pub fn archive_history(self, on: bool) -> Self
pub fn archive_history(self, on: bool) -> Self
Write immutable, checksummed segments for finished workflows. Archived journals remain available to offline export after hot retention expires.
pub fn inline_flush(self, on: bool) -> Self
pub fn backup(self, target: Arc<dyn Target>, options: BackupOptions) -> Self
pub fn backup(self, target: Arc<dyn Target>, options: BackupOptions) -> Self
Ships every sealed segment of the shared log and every completed
checkpoint to target in the background, for restore to a point in
time with crate::backup::restore or fusee restore. Local
directories in log format 3 only. See crate::backup.
pub fn codec(self, codec: Arc<dyn Codec>) -> Self
pub fn codec(self, codec: Arc<dyn Codec>) -> Self
Encrypts payloads with codec (see crate::codec::aes_gcm).
pub fn services(&self) -> Services
pub fn services(&self) -> Services
The services every shard of this engine shares.