pub struct ConnectionManagerConfig { /* private fields */ }
aio
and connection-manager
only.Expand description
ConnectionManager is the configuration for reconnect mechanism and request timing
Implementations§
source§impl ConnectionManagerConfig
impl ConnectionManagerConfig
sourcepub fn set_factor(self, factor: u64) -> ConnectionManagerConfig
pub fn set_factor(self, factor: u64) -> ConnectionManagerConfig
A multiplicative factor that will be applied to the retry delay.
For example, using a factor of 1000
will make each delay in units of seconds.
sourcepub fn set_max_delay(self, time: u64) -> ConnectionManagerConfig
pub fn set_max_delay(self, time: u64) -> ConnectionManagerConfig
Apply a maximum delay between connection attempts. The delay between attempts won’t be longer than max_delay milliseconds.
sourcepub fn set_exponent_base(self, base: u64) -> ConnectionManagerConfig
pub fn set_exponent_base(self, base: u64) -> ConnectionManagerConfig
The resulting duration is calculated by taking the base to the n
-th power,
where n
denotes the number of past attempts.
sourcepub fn set_number_of_retries(self, amount: usize) -> ConnectionManagerConfig
pub fn set_number_of_retries(self, amount: usize) -> ConnectionManagerConfig
number_of_retries times, with an exponentially increasing delay
sourcepub fn set_response_timeout(self, duration: Duration) -> ConnectionManagerConfig
pub fn set_response_timeout(self, duration: Duration) -> ConnectionManagerConfig
The new connection will time out operations after response_timeout
has passed.
sourcepub fn set_connection_timeout(
self,
duration: Duration,
) -> ConnectionManagerConfig
pub fn set_connection_timeout( self, duration: Duration, ) -> ConnectionManagerConfig
Each connection attempt to the server will time out after connection_timeout
.
sourcepub fn set_push_sender(self, sender: UnboundedSender<PushInfo>) -> Self
pub fn set_push_sender(self, sender: UnboundedSender<PushInfo>) -> Self
Sets sender channel for push values. Will fail client creation if the connection isn’t configured for RESP3 communications.
Trait Implementations§
source§impl Clone for ConnectionManagerConfig
impl Clone for ConnectionManagerConfig
source§fn clone(&self) -> ConnectionManagerConfig
fn clone(&self) -> ConnectionManagerConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ConnectionManagerConfig
impl Debug for ConnectionManagerConfig
Auto Trait Implementations§
impl Freeze for ConnectionManagerConfig
impl RefUnwindSafe for ConnectionManagerConfig
impl Send for ConnectionManagerConfig
impl Sync for ConnectionManagerConfig
impl Unpin for ConnectionManagerConfig
impl UnwindSafe for ConnectionManagerConfig
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)