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; 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 completed, failed, or cancelled local run histories whose terminal
event timestamp is strictly before terminal_before.
Suspended and running runs are never removed by this helper. Corrupt histories are returned as errors 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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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,
Auto Trait Implementations§
impl !RefUnwindSafe for LocalFileEventStore
impl !UnwindSafe for LocalFileEventStore
impl Freeze for LocalFileEventStore
impl Send for LocalFileEventStore
impl Sync for LocalFileEventStore
impl Unpin for LocalFileEventStore
impl UnsafeUnpin for LocalFileEventStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more