Class RetryStrategy
- Namespace
- PushTechnology.ClientInterface.Client.Session
- Assembly
- Diffusion.Client.dll
Defines a retry strategy.
public class RetryStrategy
- Inheritance
-
RetryStrategy
- Inherited Members
Remarks
A retry strategy will be applied when an initial to attempt to open a session fails with a SessionEstablishmentTransientException.
A retry strategy will be applied when recovering by a IRecoverableUpdateStream<TValue> following a recoverable exception.
The strategy is defined in terms of the number of milliseconds between retries and the maximum number of retries to attempt.
Since 6.9.
Constructors
RetryStrategy(int)
Creates a new retry strategy that will retry indefinitely at the specified interval.
public RetryStrategy(int interval)
Parameters
intervalintThe number of milliseconds before the first retry and between subsequent retries.
Exceptions
- ArgumentException
The exception that is thrown for invalid arguments.
RetryStrategy(int, int)
Creates a new retry strategy object.
public RetryStrategy(int interval, int attempts)
Parameters
intervalintThe number of milliseconds before the first retry and between subsequent retries.
attemptsintThe number of retry attempts.
Exceptions
- ArgumentException
The exception that is thrown for invalid arguments.
Fields
NO_RETRY
The retry strategy that indicates that no retry is to be attempted.
public static readonly RetryStrategy NO_RETRY
Field Value
- RetryStrategy
The retry strategy for no retry.
Properties
Attempts
Returns the number of retry attempts.
public int Attempts { get; set; }
Property Value
- int
The number of retry attempts.
Interval
Returns the time interval between attempts.
public int Interval { get; }
Property Value
- int
The interval.
Methods
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current retry strategy.
Returns
- bool
true if the specified object is equal to the current object; otherwise, false.
GetHashCode()
Serves as a hash function for a particular type.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
ToString()
Returns a string that represents the current retry strategy.
public override string ToString()
Returns
- string
The string that represents the current retry strategy.