pub struct QueueOptions {
pub workers: usize,
pub poll_interval: Duration,
pub stale_minutes: i32,
pub heartbeat_interval: Duration,
pub max_attempts: i32,
pub retry_backoff: Duration,
pub retention_days: i32,
pub maintenance_interval: Duration,
}Expand description
Queue tuning.
Fields§
§workers: usizeConcurrent job loops, so the most jobs this process runs at once.
poll_interval: DurationSleep between polls of an empty queue, and between schedule ticks.
stale_minutes: i32A running job not heard from for this many minutes is assumed lost with its worker.
heartbeat_interval: DurationHow often a running job reports in: at least 20 ms, and at most a quarter of
stale_minutes. QueueOptions::check refuses anything else.
max_attempts: i32Tries a job gets, including the first, unless it has its own limit. One means no retries.
retry_backoff: DurationThe wait before the first retry.
retention_days: i32Days to keep finished and cancelled rows.
maintenance_interval: DurationHow often to recover stale jobs and delete old rows.
Implementations§
Source§impl QueueOptions
impl QueueOptions
Sourcepub fn check(&self) -> Result<()>
pub fn check(&self) -> Result<()>
Whether these settings can run a queue. A setting out of range is refused here, not held to a limit.
§Errors
Error::OutOfRange, naming the setting: workers that do not fit a u32;
stale_minutes under one or too many to count in seconds; or a
heartbeat_interval under 20 ms or over a quarter of stale_minutes, so that a
run gives up two heartbeats before it is stale, and no earlier than half of it.
Trait Implementations§
Source§impl Clone for QueueOptions
impl Clone for QueueOptions
Source§impl Debug for QueueOptions
impl Debug for QueueOptions
Auto Trait Implementations§
impl Forget for QueueOptions
impl Freeze for QueueOptions
impl Move for QueueOptions
impl RefUnwindSafe for QueueOptions
impl Send for QueueOptions
impl Sync for QueueOptions
impl Unpin for QueueOptions
impl UnsafeUnpin for QueueOptions
impl UnwindSafe for QueueOptions
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