pub struct PostgresDovecote { /* private fields */ }Expand description
PostgreSQL adapter for Dovecote’s durable event and delivery schema.
Implementations§
Source§impl PostgresDovecote
impl PostgresDovecote
Sourcepub async fn enqueue<'c>(
&self,
transaction: &mut Transaction<'c, Postgres>,
event: NewEvent,
) -> Result<EnqueueOutcome, EnqueueError>
pub async fn enqueue<'c>( &self, transaction: &mut Transaction<'c, Postgres>, event: NewEvent, ) -> Result<EnqueueOutcome, EnqueueError>
Enqueues an event in the caller-owned transaction.
Sourcepub async fn import_for_migration<'c>(
&self,
transaction: &mut Transaction<'c, Postgres>,
event: NewEvent,
state: ImportedDeliveryState,
) -> Result<ImportOutcome, ImportError>
pub async fn import_for_migration<'c>( &self, transaction: &mut Transaction<'c, Postgres>, event: NewEvent, state: ImportedDeliveryState, ) -> Result<ImportOutcome, ImportError>
Imports one already-validated event and its legacy delivery state in
the caller-owned transaction. This is migration infrastructure, not a
replacement for Self::enqueue.
Sourcepub async fn finalize_pending_delivery_for_migration<'c>(
&self,
transaction: &mut Transaction<'c, Postgres>,
row_id: RowId,
delivered_at: OffsetDateTime,
) -> Result<FinalizeOutcome, FinalizeError>
pub async fn finalize_pending_delivery_for_migration<'c>( &self, transaction: &mut Transaction<'c, Postgres>, row_id: RowId, delivered_at: OffsetDateTime, ) -> Result<FinalizeOutcome, FinalizeError>
Records the legacy publisher’s authoritative delivery time for a canonical pending migration import. This operation is migration infrastructure, not an ordinary acknowledgement shortcut.
Sourcepub async fn check_schema(&self) -> Result<(), SchemaError>
pub async fn check_schema(&self) -> Result<(), SchemaError>
Verifies that the pool’s current PostgreSQL schema satisfies Dovecote migration version 1.
Sourcepub async fn page(
&self,
after_row_id: Option<RowId>,
limit: Limit,
) -> Result<Vec<PagedEvent>, PageError>
pub async fn page( &self, after_row_id: Option<RowId>, limit: Limit, ) -> Result<Vec<PagedEvent>, PageError>
Reads a bounded live page after after_row_id.
Sourcepub async fn begin_snapshot(&self) -> Result<SnapshotPager, PageError>
pub async fn begin_snapshot(&self) -> Result<SnapshotPager, PageError>
Begins a finite, repeatable-read snapshot pager.
Sourcepub async fn claim(
&self,
worker: WorkerId,
lease_for: Lease,
limit: Limit,
) -> Result<Vec<ClaimedEvent>, ClaimError>
pub async fn claim( &self, worker: WorkerId, lease_for: Lease, limit: Limit, ) -> Result<Vec<ClaimedEvent>, ClaimError>
Claims eligible events under short PostgreSQL transactions.
Sourcepub async fn renew(
&self,
row_id: RowId,
claim_token: &ClaimToken,
lease_for: Lease,
) -> Result<(), MutationError>
pub async fn renew( &self, row_id: RowId, claim_token: &ClaimToken, lease_for: Lease, ) -> Result<(), MutationError>
Renews one current, unexpired claim using PostgreSQL time.
Sourcepub async fn ack(
&self,
row_id: RowId,
claim_token: &ClaimToken,
) -> Result<(), MutationError>
pub async fn ack( &self, row_id: RowId, claim_token: &ClaimToken, ) -> Result<(), MutationError>
Acknowledges one current, unexpired claim.
Sourcepub async fn retry(
&self,
row_id: RowId,
claim_token: &ClaimToken,
failure: &Failure,
backoff: Delay,
) -> Result<(), MutationError>
pub async fn retry( &self, row_id: RowId, claim_token: &ClaimToken, failure: &Failure, backoff: Delay, ) -> Result<(), MutationError>
Returns one current, unexpired claim to pending with a failure.
Sourcepub async fn release(
&self,
row_id: RowId,
claim_token: &ClaimToken,
delay: Delay,
) -> Result<(), MutationError>
pub async fn release( &self, row_id: RowId, claim_token: &ClaimToken, delay: Delay, ) -> Result<(), MutationError>
Returns one current, unexpired claim to pending after a delay.
Sourcepub async fn quarantine(
&self,
row_id: RowId,
claim_token: &ClaimToken,
reason: &QuarantineReason,
) -> Result<(), MutationError>
pub async fn quarantine( &self, row_id: RowId, claim_token: &ClaimToken, reason: &QuarantineReason, ) -> Result<(), MutationError>
Quarantines one current, unexpired claim with an operator reason.
Trait Implementations§
Source§impl Clone for PostgresDovecote
impl Clone for PostgresDovecote
Source§fn clone(&self) -> PostgresDovecote
fn clone(&self) -> PostgresDovecote
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for PostgresDovecote
impl !UnwindSafe for PostgresDovecote
impl Freeze for PostgresDovecote
impl Send for PostgresDovecote
impl Sync for PostgresDovecote
impl Unpin for PostgresDovecote
impl UnsafeUnpin for PostgresDovecote
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
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> ⓘ
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> ⓘ
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