diff --git a/src/client/config.rs b/src/client/config.rs index eb8f70a..d057c4d 100644 --- a/src/client/config.rs +++ b/src/client/config.rs @@ -96,7 +96,7 @@ pub struct Config { /// * [`Client::send_and_forget`](crate::client::Client::send_and_forget) /// * [`Client::send_batch`](crate::client::Client::send_batch) pub retry_on_error: bool, - /// Reconnection configuration (Constant, Linear or Exponential) + /// Reconnection policy configuration (Constant, Linear or Exponential) pub reconnection: ReconnectionConfig, } @@ -880,7 +880,8 @@ pub enum ReconnectionConfig { jitter: u32, }, /// Backoff reconnection attempts exponentially, multiplying the last delay by `multiplicative_factor` each time. - /// see https://en.wikipedia.org/wiki/Exponential_backoff + /// + /// see Exponential { /// Maximum number of attemps, set `0` to retry forever. max_attempts: u32, diff --git a/src/client/mod.rs b/src/client/mod.rs index 351d86d..0e2d32f 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -213,8 +213,8 @@ of the struct [`Config`] or its dependencies: it easier to identity the connection in client list. * [`keep_alive`](Config::keep_alive) - Enable/disable keep-alive functionality (default `None`) * [`no_delay`](Config::no_delay) - Enable/disable the use of Nagle's algorithm (default `true`) -* [`max_command_attempts`](Config::max_command_attempts) - Maximum number of retry attempts to send a command to the Redis server (default `3`). * [`retry_on_error`](Config::retry_on_error) - Defines the default strategy for retries on network error (default `false`). +* [`reconnection`](Config::reconnection) - Reconnection policy configuration: Constant, Linear or Exponential (default `Constant`) * [`wait_between_failures`](SentinelConfig::wait_between_failures) - (Sentinel only) Waiting time after failing before connecting to the next Sentinel instance (default `250` ms). * [`sentinel_username`](SentinelConfig::username) - (Sentinel only) Sentinel username