Class RetryStrategy

Defines a retry strategy.

Inheritance
System.Object
RetryStrategy
Namespace: PushTechnology.ClientInterface.Client.Session
Assembly: Diffusion.Client.dll
Syntax
public class RetryStrategy : object
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(Int32)

Creates a new retry strategy that will retry indefinitely at the specified interval.

Declaration
public RetryStrategy(int interval)
Parameters
Type Name Description
System.Int32 interval

The number of milliseconds before the first retry and between subsequent retries.

RetryStrategy(Int32, Int32)

Creates a new retry strategy object.

Declaration
public RetryStrategy(int interval, int attempts)
Parameters
Type Name Description
System.Int32 interval

The number of milliseconds before the first retry and between subsequent retries.

System.Int32 attempts

The number of retry attempts.

Fields

NO_RETRY

The retry strategy that indicates that no retry is to be attempted.

Declaration
public static readonly RetryStrategy NO_RETRY
Field Value
Type Description
RetryStrategy

The retry strategy for no retry.

Properties

Attempts

Returns the number of retry attempts.

Declaration
public int Attempts { get; set; }
Property Value
Type Description
System.Int32

The number of retry attempts.

Interval

Returns the time interval between attempts.

Declaration
public int Interval { get; }
Property Value
Type Description
System.Int32

The interval.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj

The object to compare with the current retry strategy.

Returns
Type Description
System.Boolean

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as a hash function for a particular type.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

A hash code for the current object.

ToString()

Returns a string that represents the current retry strategy.

Declaration
public override string ToString()
Returns
Type Description
System.String

The string that represents the current retry strategy.

Back to top