pub struct JournalConfig {
pub enabled: bool,
pub max_bytes_per_view: u64,
pub max_records_per_view: usize,
pub max_age: Duration,
}Expand description
Retention bounds for the event journal. Whichever bound bites first wins.
Fields§
§enabled: boolMaster opt-in. Disabled leaves append views on their previous latest-state delivery.
max_bytes_per_view: u64Retained bytes per view, counting frames plus per-record overhead.
This is the bound to budget against: frame size is stack-dependent, so a record count cannot be reasoned about against a memory limit.
max_records_per_view: usizeRetained records per view. A backstop against pathologically small frames; the byte bound is the one that should normally bite.
max_age: DurationRecords older than this are dropped even when the size bounds are not reached, so a quiet view does not advertise a stale replay window.
Implementations§
Source§impl JournalConfig
impl JournalConfig
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Load from ARETE_JOURNAL_*. Stays disabled unless
ARETE_JOURNAL_ENABLED=true.
An embedder hosting several deployments in one process should use
crate::ServerBuilder::journal instead, which takes these as the
default and overrides them per runtime.