Skip to main content

Config

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: Duration

The longest a suspended run stays loaded (its code and journal in memory); Duration::MAX never parks.

§memory_budget: u64

Bytes 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: bool

Checkpoint each shard on Engine::shutdown, so the next open replays nothing and covered log segments are deleted.

§shared_log: bool

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: Duration

A 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: usize

Bounded command queue per shard; a full queue makes calls Busy.

§keep_history: bool

Keep finished runs’ whole journals (for audit, inspect, export and reset of finished runs).

§on_exhausted: Exhausted

What a step does when its retries run out, unless its retry policy says (crate::Exhausted; default: fail).

§archive_history: bool

Archive 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: u64

A 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

pub fn local(dir: impl AsRef<Path>) -> Self

local durability with the data directory at dir.

pub fn memory() -> Self

memory durability: nothing is written.

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 shared_log(self, on: bool) -> 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

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

See crate::dev. Without it, FUSEE_PROFILE decides.

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

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

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

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

Encrypts payloads with codec (see crate::codec::aes_gcm).

pub fn services(&self) -> Services

The services every shard of this engine shares.

Trait Implementations§

§

impl Clone for Config

§

fn clone(&self) -> Config

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
§

impl Debug for Config

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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, 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.