pub struct JobQueueConfig {
pub batch_size: u32,
pub poll_interval: Duration,
pub max_attempts: u32,
pub backoff_base_secs: u64,
pub backoff_cap_secs: u64,
pub lease_seconds: u64,
pub jitter_ratio: f64,
pub handler_timeout: Duration,
}Expand description
worker 配置
Fields§
§batch_size: u32每轮最多领取的任务数
poll_interval: Duration轮询间隔
max_attempts: u32单任务最大重试次数(超过进入死信)
backoff_base_secs: u64指数退避基数(秒):base * 2^min(attempts, 6)
backoff_cap_secs: u64退避上限(秒)
lease_seconds: u64running 租约时长(秒):worker 崩溃后超时回收
jitter_ratio: f64退避随机抖动比例(0~1),避免批量失败任务同时冲击下游
handler_timeout: Duration单次 handler 执行超时
Trait Implementations§
Source§impl Clone for JobQueueConfig
impl Clone for JobQueueConfig
Source§fn clone(&self) -> JobQueueConfig
fn clone(&self) -> JobQueueConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for JobQueueConfig
impl Debug for JobQueueConfig
Auto Trait Implementations§
impl Freeze for JobQueueConfig
impl RefUnwindSafe for JobQueueConfig
impl Send for JobQueueConfig
impl Sync for JobQueueConfig
impl Unpin for JobQueueConfig
impl UnsafeUnpin for JobQueueConfig
impl UnwindSafe for JobQueueConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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