pub struct QueueConfig { /* private fields */ }Expand description
Queue behaviour
Implementations§
Source§impl QueueConfig
impl QueueConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
5 attempts, backoff 1 s doubling up to 1 h with +-20 % jitter, nothing persisted, the last 1000 dead jobs kept
Sourcepub fn max_attempts(self, n: u32) -> Self
pub fn max_attempts(self, n: u32) -> Self
Total tries per job including the first (at least 1)
Sourcepub fn base_delay(self, d: Duration) -> Self
pub fn base_delay(self, d: Duration) -> Self
Delay before the first retry; it doubles with every failed attempt
pub fn max_delay(self, d: Duration) -> Self
Sourcepub fn jitter(self, on: bool) -> Self
pub fn jitter(self, on: bool) -> Self
Spread retries by +-20 % so that jobs failing together do not retry together
Sourcepub fn persist_to(self, path: impl Into<PathBuf>) -> Self
pub fn persist_to(self, path: impl Into<PathBuf>) -> Self
Keep the queue in this JSON file (written atomically after changes)
Sourcepub fn dead_letter_limit(self, n: usize) -> Self
pub fn dead_letter_limit(self, n: usize) -> Self
How many dead jobs to remember (the oldest are dropped)
Trait Implementations§
Source§impl Clone for QueueConfig
impl Clone for QueueConfig
Auto Trait Implementations§
impl !RefUnwindSafe for QueueConfig
impl !UnwindSafe for QueueConfig
impl Freeze for QueueConfig
impl Send for QueueConfig
impl Sync for QueueConfig
impl Unpin for QueueConfig
impl UnsafeUnpin for QueueConfig
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