pub struct PostgresStore { /* private fields */ }Expand description
PostgreSQL implementation of Store trait
Implementations§
Trait Implementations§
Source§impl Clone for PostgresStore
impl Clone for PostgresStore
Source§impl InsightStore for PostgresStore
impl InsightStore for PostgresStore
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 PostgresStore
impl Store for PostgresStore
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,
attempts: 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,
attempts: 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,
reason: 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,
reason: 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,
reason: 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,
reason: 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 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
Source§fn get_workflow_status<'life0, 'async_trait>(
&'life0 self,
correlation_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<WorkflowStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_workflow_status<'life0, 'async_trait>(
&'life0 self,
correlation_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<WorkflowStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get workflow status for a correlation ID 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.Auto Trait Implementations§
impl Freeze for PostgresStore
impl !RefUnwindSafe for PostgresStore
impl Send for PostgresStore
impl Sync for PostgresStore
impl Unpin for PostgresStore
impl !UnwindSafe for PostgresStore
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more