pub struct ClaimerBuilder<I: Job, DE, DF, DFut>where
DF: Fn(I, usize) -> DFut + 'static + Send + Sync,
DE: Display + Send + 'static,
DFut: Future<Output = Result<(), DE>> + Send,{ /* private fields */ }Expand description
Builder for constructing a Claimer.
Construct via ClaimerBuilder::new() and configure with chained setters:
ⓘ
let claimer = ClaimerBuilder::new()
.min_idle_time(30_000)
.max_retries(3)
.dlq_worker(|payload: &Email, attempts| async move {
Ok::<(), String>(())
});Implementations§
Source§impl<I> ClaimerBuilder<I, NoDlqError, NoDlqFn<I>, NoDlqFut>where
I: Job,
impl<I> ClaimerBuilder<I, NoDlqError, NoDlqFn<I>, NoDlqFut>where
I: Job,
Source§impl<I, DE, DF, DFut> ClaimerBuilder<I, DE, DF, DFut>
impl<I, DE, DF, DFut> ClaimerBuilder<I, DE, DF, DFut>
Sourcepub fn min_idle_time(self, ms: usize) -> Self
pub fn min_idle_time(self, ms: usize) -> Self
Minimum idle time (ms) before a message is eligible for reclaiming.
Sourcepub fn block_timeout(self, ms: usize) -> Self
pub fn block_timeout(self, ms: usize) -> Self
How long (ms) the claimer sleeps when there are no claimable messages.
Sourcepub fn max_concurrent_tasks(self, n: usize) -> Self
pub fn max_concurrent_tasks(self, n: usize) -> Self
Maximum messages reclaimed concurrently.
Sourcepub fn max_retries(self, n: usize) -> Self
pub fn max_retries(self, n: usize) -> Self
Delivery attempts before a message is sent to the DLQ.
Sourcepub fn dlq_worker<DE2, DF2, DFut2>(
self,
worker: DF2,
) -> ClaimerBuilder<I, DE2, DF2, DFut2>
pub fn dlq_worker<DE2, DF2, DFut2>( self, worker: DF2, ) -> ClaimerBuilder<I, DE2, DF2, DFut2>
Attach a dead-letter callback.
Changes the builder’s generic parameters to match the worker’s signature.
Trait Implementations§
Auto Trait Implementations§
impl<I, DE, DF, DFut> Freeze for ClaimerBuilder<I, DE, DF, DFut>
impl<I, DE, DF, DFut> RefUnwindSafe for ClaimerBuilder<I, DE, DF, DFut>
impl<I, DE, DF, DFut> Send for ClaimerBuilder<I, DE, DF, DFut>where
I: Send,
impl<I, DE, DF, DFut> Sync for ClaimerBuilder<I, DE, DF, DFut>
impl<I, DE, DF, DFut> Unpin for ClaimerBuilder<I, DE, DF, DFut>
impl<I, DE, DF, DFut> UnsafeUnpin for ClaimerBuilder<I, DE, DF, DFut>
impl<I, DE, DF, DFut> UnwindSafe for ClaimerBuilder<I, DE, DF, DFut>
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