Class ExponentialRetry
- Namespace
- StackExchange.Redis
- Assembly
- StackExchange.Redis.StrongName.dll
Represents a retry policy that performs retries, using a randomized exponential back off scheme to determine the interval between retries.
public class ExponentialRetry : IReconnectRetryPolicy
- Inheritance
-
ExponentialRetry
- Implements
- Inherited Members
Constructors
ExponentialRetry(int)
Initializes a new instance using the specified back off interval with default maxDeltaBackOffMilliseconds of 10 seconds
public ExponentialRetry(int deltaBackOffMilliseconds)
Parameters
deltaBackOffMilliseconds
inttime in milliseconds for the back-off interval between retries
ExponentialRetry(int, int)
Initializes a new instance using the specified back off interval.
public ExponentialRetry(int deltaBackOffMilliseconds, int maxDeltaBackOffMilliseconds)
Parameters
deltaBackOffMilliseconds
inttime in milliseconds for the back-off interval between retries
maxDeltaBackOffMilliseconds
inttime in milliseconds for the maximum value that the back-off interval can exponentailly grow upto
Methods
ShouldRetry(long, int)
This method is called by the ConnectionMultiplexer to determine if a reconnect operation can be retried now.
public bool ShouldRetry(long currentRetryCount, int timeElapsedMillisecondsSinceLastRetry)
Parameters
currentRetryCount
longThe number of times reconnect retries have already been made by the ConnectionMultiplexer while it was in the connecting state
timeElapsedMillisecondsSinceLastRetry
intTotal elapsed time in milliseconds since the last reconnect retry was made