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: Dse
Assembly: Dse.dll
Syntax
public class ExponentialReconnectionPolicy : IReconnectionPolicy
Constructors
ExponentialReconnectionPolicy(Int64, Int64)
Creates a reconnection policy waiting exponentially longer for each new attempt.
Declaration
public ExponentialReconnectionPolicy(long baseDelayMs, long maxDelayMs)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | baseDelayMs | the base delay in milliseconds to use for the schedules created by this policy. |
System.Int64 | 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 |
---|---|
System.Int64 |
MaxDelayMs
Gets the maximum delay in milliseconds between reconnection attempts for this policy.
Declaration
public long MaxDelayMs { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
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. |