pub struct MemoryStore { /* private fields */ }Expand description
In-memory store for workflows
Implementations§
Source§impl MemoryStore
impl MemoryStore
Trait Implementations§
Source§impl Clone for MemoryStore
impl Clone for MemoryStore
Source§fn clone(&self) -> MemoryStore
fn clone(&self) -> MemoryStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for MemoryStore
impl Default for MemoryStore
Source§impl InsightStore for MemoryStore
impl InsightStore for MemoryStore
Source§fn subscribe_events<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = InsightEvent> + Send + Unpin>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_events<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = InsightEvent> + Send + Unpin>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Subscribe to live events for all workflows Read more
Source§fn get_workflow_tree<'life0, 'async_trait>(
&'life0 self,
correlation_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<WorkflowTree>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_workflow_tree<'life0, 'async_trait>(
&'life0 self,
correlation_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<WorkflowTree>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get workflow tree for visualization Read more
Source§fn get_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<InsightStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<InsightStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get aggregate statistics Read more
Source§fn get_recent_events<'life0, 'async_trait>(
&'life0 self,
cursor: Option<i64>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<InsightEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_recent_events<'life0, 'async_trait>(
&'life0 self,
cursor: Option<i64>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<InsightEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get recent events with cursor-based pagination Read more
Source§fn get_effect_logs<'life0, 'async_trait>(
&'life0 self,
correlation_id: Option<Uuid>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<EffectExecutionLog>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_effect_logs<'life0, 'async_trait>(
&'life0 self,
correlation_id: Option<Uuid>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<EffectExecutionLog>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get effect execution logs for operational debugging. Read more
Source§impl Store for MemoryStore
impl Store for MemoryStore
Source§fn publish<'life0, 'async_trait>(
&'life0 self,
event: QueuedEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn publish<'life0, 'async_trait>(
&'life0 self,
event: QueuedEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Publish event to queue Read more
Source§fn poll_next<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<QueuedEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn poll_next<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<QueuedEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Poll next event (per-workflow FIFO with advisory locks) Read more
Source§fn ack<'life0, 'async_trait>(
&'life0 self,
_id: i64,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ack<'life0, 'async_trait>(
&'life0 self,
_id: i64,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Acknowledge event processing completion Read more
Source§fn nack<'life0, 'async_trait>(
&'life0 self,
_id: i64,
_retry_after_secs: u64,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn nack<'life0, 'async_trait>(
&'life0 self,
_id: i64,
_retry_after_secs: u64,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Nack event (failed, retry later) Read more
Source§fn load_state<'life0, 'async_trait, S>(
&'life0 self,
correlation_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<(S, i32)>>> + Send + 'async_trait>>where
S: for<'de> Deserialize<'de> + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
fn load_state<'life0, 'async_trait, S>(
&'life0 self,
correlation_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<(S, i32)>>> + Send + 'async_trait>>where
S: for<'de> Deserialize<'de> + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
Load state for workflow Read more
Source§fn save_state<'life0, 'life1, 'async_trait, S>(
&'life0 self,
correlation_id: Uuid,
state: &'life1 S,
expected_version: i32,
) -> Pin<Box<dyn Future<Output = Result<i32>> + Send + 'async_trait>>
fn save_state<'life0, 'life1, 'async_trait, S>( &'life0 self, correlation_id: Uuid, state: &'life1 S, expected_version: i32, ) -> Pin<Box<dyn Future<Output = Result<i32>> + Send + 'async_trait>>
Save state for workflow (optimistic locking) Read more
Source§fn insert_effect_intent<'life0, 'async_trait>(
&'life0 self,
event_id: Uuid,
effect_id: String,
correlation_id: Uuid,
event_type: String,
event_payload: Value,
parent_event_id: Option<Uuid>,
batch_id: Option<Uuid>,
batch_index: Option<i32>,
batch_size: Option<i32>,
execute_at: DateTime<Utc>,
timeout_seconds: i32,
max_attempts: i32,
priority: i32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn insert_effect_intent<'life0, 'async_trait>(
&'life0 self,
event_id: Uuid,
effect_id: String,
correlation_id: Uuid,
event_type: String,
event_payload: Value,
parent_event_id: Option<Uuid>,
batch_id: Option<Uuid>,
batch_index: Option<i32>,
batch_size: Option<i32>,
execute_at: DateTime<Utc>,
timeout_seconds: i32,
max_attempts: i32,
priority: i32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert effect execution intent Read more
Source§fn poll_next_effect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<QueuedEffectExecution>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn poll_next_effect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<QueuedEffectExecution>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Poll next ready effect (priority-based) Read more
Source§fn complete_effect<'life0, 'async_trait>(
&'life0 self,
event_id: Uuid,
effect_id: String,
result: Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn complete_effect<'life0, 'async_trait>(
&'life0 self,
event_id: Uuid,
effect_id: String,
result: Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Mark effect execution as completed
Source§fn complete_effect_with_events<'life0, 'async_trait>(
&'life0 self,
event_id: Uuid,
effect_id: String,
result: Value,
emitted_events: Vec<EmittedEvent>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn complete_effect_with_events<'life0, 'async_trait>(
&'life0 self,
event_id: Uuid,
effect_id: String,
result: Value,
emitted_events: Vec<EmittedEvent>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Complete effect and atomically publish emitted events (crash-safe) Read more
Source§fn fail_effect<'life0, 'async_trait>(
&'life0 self,
event_id: Uuid,
effect_id: String,
error: String,
_retry_after_secs: i32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fail_effect<'life0, 'async_trait>(
&'life0 self,
event_id: Uuid,
effect_id: String,
error: String,
_retry_after_secs: i32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Mark effect execution as failed and schedule retry (store-defined backoff)
Source§fn dlq_effect<'life0, 'async_trait>(
&'life0 self,
event_id: Uuid,
effect_id: String,
error: String,
error_type: String,
attempts: i32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn dlq_effect<'life0, 'async_trait>(
&'life0 self,
event_id: Uuid,
effect_id: String,
error: String,
error_type: String,
attempts: i32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Move effect to DLQ (permanently failed)
Source§fn dlq_effect_with_events<'life0, 'async_trait>(
&'life0 self,
event_id: Uuid,
effect_id: String,
error: String,
error_type: String,
attempts: i32,
emitted_events: Vec<EmittedEvent>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn dlq_effect_with_events<'life0, 'async_trait>(
&'life0 self,
event_id: Uuid,
effect_id: String,
error: String,
error_type: String,
attempts: i32,
emitted_events: Vec<EmittedEvent>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Move effect to DLQ and atomically publish mapped terminal events. Read more
Source§fn join_same_batch_append_and_maybe_claim<'life0, 'async_trait>(
&'life0 self,
join_effect_id: String,
correlation_id: Uuid,
source_event_id: Uuid,
source_event_type: String,
source_payload: Value,
source_created_at: DateTime<Utc>,
batch_id: Uuid,
batch_index: i32,
batch_size: i32,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<JoinEntry>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn join_same_batch_append_and_maybe_claim<'life0, 'async_trait>(
&'life0 self,
join_effect_id: String,
correlation_id: Uuid,
source_event_id: Uuid,
source_event_type: String,
source_payload: Value,
source_created_at: DateTime<Utc>,
batch_id: Uuid,
batch_index: i32,
batch_size: i32,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<JoinEntry>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Append a terminal item into a same-batch join window and attempt to claim
the window for processing when complete. Read more
Source§fn join_same_batch_complete<'life0, 'async_trait>(
&'life0 self,
join_effect_id: String,
correlation_id: Uuid,
batch_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn join_same_batch_complete<'life0, 'async_trait>(
&'life0 self,
join_effect_id: String,
correlation_id: Uuid,
batch_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Mark a claimed same-batch window as completed and clear durable join rows.
Source§fn join_same_batch_release<'life0, 'async_trait>(
&'life0 self,
join_effect_id: String,
correlation_id: Uuid,
batch_id: Uuid,
_error: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn join_same_batch_release<'life0, 'async_trait>(
&'life0 self,
join_effect_id: String,
correlation_id: Uuid,
batch_id: Uuid,
_error: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Release a claimed same-batch window back to
open state after a handler
error so retries can claim it again.Source§fn subscribe_workflow_events<'life0, 'async_trait>(
&'life0 self,
_correlation_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = WorkflowEvent> + Send + Unpin>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_workflow_events<'life0, 'async_trait>(
&'life0 self,
_correlation_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = WorkflowEvent> + Send + Unpin>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Subscribe to events for a specific workflow via LISTEN/NOTIFY. Read more
Auto Trait Implementations§
impl Freeze for MemoryStore
impl !RefUnwindSafe for MemoryStore
impl Send for MemoryStore
impl Sync for MemoryStore
impl Unpin for MemoryStore
impl !UnwindSafe for MemoryStore
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