pub struct OutboxDrainer<H> { /* private fields */ }Available on crate feature
outbox only.Expand description
Polling drainer delivering entity_outbox rows to a handler.
Implementations§
Source§impl<H> OutboxDrainer<H>where
H: OutboxHandler,
impl<H> OutboxDrainer<H>where
H: OutboxHandler,
Sourcepub fn new(pool: Pool<Postgres>, handler: H) -> OutboxDrainer<H>
pub fn new(pool: Pool<Postgres>, handler: H) -> OutboxDrainer<H>
Create a drainer with defaults: batch 32, poll every second, backoff base 5s, 10 attempts.
Sourcepub fn batch_size(self, batch_size: i64) -> OutboxDrainer<H>
pub fn batch_size(self, batch_size: i64) -> OutboxDrainer<H>
Set the maximum rows claimed per polling cycle.
Sourcepub fn poll_interval(self, poll_interval: Duration) -> OutboxDrainer<H>
pub fn poll_interval(self, poll_interval: Duration) -> OutboxDrainer<H>
Set the sleep between empty polling cycles.
Sourcepub fn base_backoff(self, base_backoff: Duration) -> OutboxDrainer<H>
pub fn base_backoff(self, base_backoff: Duration) -> OutboxDrainer<H>
Set the exponential-backoff base delay.
Sourcepub fn max_attempts(self, max_attempts: i32) -> OutboxDrainer<H>
pub fn max_attempts(self, max_attempts: i32) -> OutboxDrainer<H>
Set the retry ceiling before a row is parked.
Auto Trait Implementations§
impl<H> !RefUnwindSafe for OutboxDrainer<H>
impl<H> !UnwindSafe for OutboxDrainer<H>
impl<H> Freeze for OutboxDrainer<H>where
H: Freeze,
impl<H> Send for OutboxDrainer<H>where
H: Send,
impl<H> Sync for OutboxDrainer<H>where
H: Sync,
impl<H> Unpin for OutboxDrainer<H>where
H: Unpin,
impl<H> UnsafeUnpin for OutboxDrainer<H>where
H: UnsafeUnpin,
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> 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