pub struct ReconnectPolicy {
pub max_retries: u32,
pub initial_delay_ms: u64,
pub max_delay_ms: u64,
pub multiplier: f64,
}Expand description
重连策略(指数退避)
用于 QueueWrapper::with_reconnect,在网络错误(MqError::Connection)时自动重试。
max_retries:最大重试次数(默认 5)initial_delay_ms:初始延迟毫秒(默认 100)max_delay_ms:最大延迟毫秒(默认 10000)multiplier:退避倍数(默认 2.0,指数退避)
Fields§
§max_retries: u32最大重试次数(默认 5)
initial_delay_ms: u64初始延迟(毫秒,默认 100)
max_delay_ms: u64最大延迟(毫秒,默认 10000)
multiplier: f64退避倍数(默认 2.0,指数退避)
Implementations§
Trait Implementations§
Source§impl Clone for ReconnectPolicy
impl Clone for ReconnectPolicy
Source§fn clone(&self) -> ReconnectPolicy
fn clone(&self) -> ReconnectPolicy
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 ReconnectPolicy
impl Debug for ReconnectPolicy
Auto Trait Implementations§
impl Freeze for ReconnectPolicy
impl RefUnwindSafe for ReconnectPolicy
impl Send for ReconnectPolicy
impl Sync for ReconnectPolicy
impl Unpin for ReconnectPolicy
impl UnsafeUnpin for ReconnectPolicy
impl UnwindSafe for ReconnectPolicy
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