Table of Contents

Class RetryPolicyOptions

Namespace
LinqToDB.Data.RetryPolicy
Assembly
linq2db.dll
public sealed record RetryPolicyOptions : IOptionSet, IConfigurationID, IEquatable<RetryPolicyOptions>
Inheritance
RetryPolicyOptions
Implements
Inherited Members
Extension Methods

Constructors

RetryPolicyOptions()

public RetryPolicyOptions()

RetryPolicyOptions(IRetryPolicy?, Func<DataConnection, IRetryPolicy?>?, int, TimeSpan, double, double, TimeSpan)

public RetryPolicyOptions(IRetryPolicy? RetryPolicy = null, Func<DataConnection, IRetryPolicy?>? Factory = null, int MaxRetryCount = 0, TimeSpan MaxDelay = default, double RandomFactor = 0, double ExponentialBase = 0, TimeSpan Coefficient = default)

Parameters

RetryPolicy IRetryPolicy

Retry policy for new DataConnection instance.

Factory Func<DataConnection, IRetryPolicy>

Retry policy factory method, used to create retry policy for new DataConnection instance. If factory method is not set, retry policy is not used.

MaxRetryCount int

The number of retry attempts.

MaxDelay TimeSpan

The maximum time delay between retries, must be nonnegative.

RandomFactor double

The maximum random factor, must not be lesser than 1.

ExponentialBase double

The base for the exponential function used to compute the delay between retries, must be positive.

Coefficient TimeSpan

The coefficient for the exponential function used to compute the delay between retries, must be nonnegative.

Properties

Coefficient

The coefficient for the exponential function used to compute the delay between retries, must be nonnegative.

public TimeSpan Coefficient { get; init; }

Property Value

TimeSpan

ExponentialBase

The base for the exponential function used to compute the delay between retries, must be positive.

public double ExponentialBase { get; init; }

Property Value

double

Factory

Retry policy factory method, used to create retry policy for new DataConnection instance. If factory method is not set, retry policy is not used.

public Func<DataConnection, IRetryPolicy?>? Factory { get; init; }

Property Value

Func<DataConnection, IRetryPolicy>

MaxDelay

The maximum time delay between retries, must be nonnegative.

public TimeSpan MaxDelay { get; init; }

Property Value

TimeSpan

MaxRetryCount

The number of retry attempts.

public int MaxRetryCount { get; init; }

Property Value

int

RandomFactor

The maximum random factor, must not be lesser than 1.

public double RandomFactor { get; init; }

Property Value

double

RetryPolicy

Retry policy for new DataConnection instance.

public IRetryPolicy? RetryPolicy { get; init; }

Property Value

IRetryPolicy

Methods

Deconstruct(out IRetryPolicy?, out Func<DataConnection, IRetryPolicy?>?, out int, out TimeSpan, out double, out double, out TimeSpan)

public void Deconstruct(out IRetryPolicy? RetryPolicy, out Func<DataConnection, IRetryPolicy?>? Factory, out int MaxRetryCount, out TimeSpan MaxDelay, out double RandomFactor, out double ExponentialBase, out TimeSpan Coefficient)

Parameters

RetryPolicy IRetryPolicy
Factory Func<DataConnection, IRetryPolicy>
MaxRetryCount int
MaxDelay TimeSpan
RandomFactor double
ExponentialBase double
Coefficient TimeSpan

Equals(RetryPolicyOptions?)

public bool Equals(RetryPolicyOptions? other)

Parameters

other RetryPolicyOptions

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

<Clone>$()

public RetryPolicyOptions <Clone>$()

Returns

RetryPolicyOptions

Operators

operator ==(RetryPolicyOptions?, RetryPolicyOptions?)

public static bool operator ==(RetryPolicyOptions? left, RetryPolicyOptions? right)

Parameters

left RetryPolicyOptions
right RetryPolicyOptions

Returns

bool

operator !=(RetryPolicyOptions?, RetryPolicyOptions?)

public static bool operator !=(RetryPolicyOptions? left, RetryPolicyOptions? right)

Parameters

left RetryPolicyOptions
right RetryPolicyOptions

Returns

bool