pub struct LocalFileEventStore { /* private fields */ }Expand description
JSONL-backed event store for local durable runs.
Each workflow run is stored as <root>/<run_id>.jsonl; every line is a full
FlowEventEnvelope. The store serializes appends inside this process, but
it does not provide cross-process locking. Use it for local development,
embedded Rust hosts, and crash/restart durability. An unterminated malformed
tail is treated as a torn append and truncated before the next write;
terminated or interior corruption remains an error. Use a database-backed
store for multi-writer deployments.
Implementations§
Source§impl LocalFileEventStore
impl LocalFileEventStore
pub fn new(root: impl Into<PathBuf>) -> Self
pub fn root(&self) -> &Path
Sourcepub async fn prune_terminal_runs_older_than(
&self,
terminal_before: DateTime<Utc>,
) -> Result<Vec<String>>
pub async fn prune_terminal_runs_older_than( &self, terminal_before: DateTime<Utc>, ) -> Result<Vec<String>>
Remove complete linked components of terminal local run histories whose
terminal event timestamps are strictly before terminal_before.
A running, suspended, or recent parent or child protects every history linked to it. Corrupt histories and dangling child references are returned as errors or retained rather than deleted, so operators can inspect them before cleanup.
Trait Implementations§
Source§impl Clone for LocalFileEventStore
impl Clone for LocalFileEventStore
Source§fn clone(&self) -> LocalFileEventStore
fn clone(&self) -> LocalFileEventStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LocalFileEventStore
impl Debug for LocalFileEventStore
Source§impl FlowEventStore for LocalFileEventStore
impl FlowEventStore for LocalFileEventStore
fn append<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
event: FlowEvent,
) -> Pin<Box<dyn Future<Output = Result<FlowEventEnvelope>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append_if_sequence<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
expected_sequence: u64,
event: FlowEvent,
) -> Pin<Box<dyn Future<Output = Result<FlowEventEnvelope>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<FlowEventEnvelope>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_run_ids<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn list_due_wakeups<'life0, 'async_trait>(
&'life0 self,
now: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ScheduledWakeup>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_due_wakeups<'life0, 'async_trait>(
&'life0 self,
now: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ScheduledWakeup>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
now. Read more