pub struct PostgresPendingStore { /* private fields */ }Expand description
PostgreSQL-backed PendingAdjudicationPort implementation.
Uses the same r2d2 pool as PostgresPersistenceStore. Each method borrows a pooled
connection for the duration of a single non-transactional statement (auto-commit).
Serialization is provided by the per-agent write lock in EngineHandle.
Implementations§
Source§impl PostgresPendingStore
impl PostgresPendingStore
Sourcepub fn new(pool: Pool<PostgresConnectionManager<NoTls>>) -> Self
pub fn new(pool: Pool<PostgresConnectionManager<NoTls>>) -> Self
Create a pending store sharing the same connection pool.
Trait Implementations§
Source§impl PendingAdjudicationPort for PostgresPendingStore
impl PendingAdjudicationPort for PostgresPendingStore
Source§fn list_queued_orphan_claims(
&self,
) -> Result<Vec<OrphanedQueuedClaim>, PostgresStoreError>
fn list_queued_orphan_claims( &self, ) -> Result<Vec<OrphanedQueuedClaim>, PostgresStoreError>
Detect QueuedForAdjudication claims with no matching pending row (Postgres adapter).
Same approach as SQLite: cross-table query joining ledger_entries + claims + pending_adjudications.
type Error = PostgresStoreError
Source§fn insert_pending(
&self,
row: &PendingAdjudicationRow,
) -> Result<(), PostgresStoreError>
fn insert_pending( &self, row: &PendingAdjudicationRow, ) -> Result<(), PostgresStoreError>
Persist a new pending-adjudication row (status = ‘pending’, expires_at = NULL). Read more
Source§fn get_pending(
&self,
handle_id: Uuid,
) -> Result<Option<PendingAdjudicationRow>, PostgresStoreError>
fn get_pending( &self, handle_id: Uuid, ) -> Result<Option<PendingAdjudicationRow>, PostgresStoreError>
Lookup a pending row by its
handle_id. Returns None if not found.Source§fn list_pending(
&self,
agent_id: Option<&AgentId>,
) -> Result<Vec<PendingAdjudicationRow>, PostgresStoreError>
fn list_pending( &self, agent_id: Option<&AgentId>, ) -> Result<Vec<PendingAdjudicationRow>, PostgresStoreError>
List all pending rows for an agent (or all agents if
agent_id is None).
Ordered by queued_at ASC.Source§fn list_expired(
&self,
now: DateTime<Utc>,
) -> Result<Vec<PendingAdjudicationRow>, PostgresStoreError>
fn list_expired( &self, now: DateTime<Utc>, ) -> Result<Vec<PendingAdjudicationRow>, PostgresStoreError>
List all rows whose
expires_at is not NULL, expires_at <= now, and status = 'pending'.
Used by the sweep use-case. Ordered by expires_at ASC.Source§fn mark_resolved(&self, handle_id: Uuid) -> Result<(), PostgresStoreError>
fn mark_resolved(&self, handle_id: Uuid) -> Result<(), PostgresStoreError>
Mark a pending row as resolved (status = ‘resolved’). Used by the verdict-apply step. Read more
Source§fn mark_expired(&self, handle_id: Uuid) -> Result<(), PostgresStoreError>
fn mark_expired(&self, handle_id: Uuid) -> Result<(), PostgresStoreError>
Mark a pending row as expired (status = ‘expired’). Used by the sweep and lazy expiry path. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for PostgresPendingStore
impl !UnwindSafe for PostgresPendingStore
impl Freeze for PostgresPendingStore
impl Send for PostgresPendingStore
impl Sync for PostgresPendingStore
impl Unpin for PostgresPendingStore
impl UnsafeUnpin for PostgresPendingStore
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