Table of Contents

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 int

time 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 int

time in milliseconds for the back-off interval between retries

maxDeltaBackOffMilliseconds int

time 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 long

The number of times reconnect retries have already been made by the ConnectionMultiplexer while it was in the connecting state

timeElapsedMillisecondsSinceLastRetry int

Total elapsed time in milliseconds since the last reconnect retry was made

Returns

bool