Class ExponentialReconnectionPolicy
A reconnection policy that waits exponentially longer between each reconnection attempt (but keeps a constant delay once a maximum delay is reached).
Inheritance
Implements
Inherited Members
Namespace: Cassandra
Assembly: Cassandra.dll
Syntax
public class ExponentialReconnectionPolicy : IReconnectionPolicy
Constructors
ExponentialReconnectionPolicy(long, long)
Creates a reconnection policy waiting exponentially longer for each new attempt.
Declaration
public ExponentialReconnectionPolicy(long baseDelayMs, long maxDelayMs)
Parameters
Type | Name | Description |
---|---|---|
long | baseDelayMs | the base delay in milliseconds to use for the schedules created by this policy. |
long | maxDelayMs | the maximum delay to wait between two attempts. |
Properties
BaseDelayMs
Gets the base delay in milliseconds for this policy (e.g. the delay before the first reconnection attempt).
Declaration
public long BaseDelayMs { get; }
Property Value
Type | Description |
---|---|
long |
MaxDelayMs
Gets the maximum delay in milliseconds between reconnection attempts for this policy.
Declaration
public long MaxDelayMs { get; }
Property Value
Type | Description |
---|---|
long |
Methods
NewSchedule()
A new schedule that used an exponentially growing delay between reconnection attempts.
For this schedule, reconnection attempt i
will be
tried Math.min(2^(i-1) * BaseDelayMs, MaxDelayMs)
milliseconds after the previous one.
Declaration
public IReconnectionSchedule NewSchedule()
Returns
Type | Description |
---|---|
IReconnectionSchedule | the newly created schedule. |