Class RetryPolicyOptions
Namespace: LinqToDB.Data.RetryPolicy
Assembly: linq2db.dll
Syntax
public sealed record RetryPolicyOptions : IOptionSet, IConfigurationID, IEquatable<RetryPolicyOptions>
Constructors
| Improve this Doc View SourceRetryPolicyOptions()
Declaration
public RetryPolicyOptions()
RetryPolicyOptions(IRetryPolicy?, Func<DataConnection, IRetryPolicy?>?, int, TimeSpan, double, double, TimeSpan)
Declaration
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
Type | Name | Description |
---|---|---|
IRetryPolicy | RetryPolicy | Retry policy for new DataConnection instance. |
Func<DataConnection, IRetryPolicy> | 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. |
int | MaxRetryCount | The number of retry attempts. |
TimeSpan | MaxDelay | The maximum time delay between retries, must be nonnegative. |
double | RandomFactor | The maximum random factor, must not be lesser than 1. |
double | ExponentialBase | The base for the exponential function used to compute the delay between retries, must be positive. |
TimeSpan | Coefficient | The coefficient for the exponential function used to compute the delay between retries, must be nonnegative. |
Properties
| Improve this Doc View SourceCoefficient
The coefficient for the exponential function used to compute the delay between retries, must be nonnegative.
Declaration
public TimeSpan Coefficient { get; init; }
Property Value
Type | Description |
---|---|
TimeSpan |
ExponentialBase
The base for the exponential function used to compute the delay between retries, must be positive.
Declaration
public double ExponentialBase { get; init; }
Property Value
Type | Description |
---|---|
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.
Declaration
public Func<DataConnection, IRetryPolicy?>? Factory { get; init; }
Property Value
Type | Description |
---|---|
Func<DataConnection, IRetryPolicy> |
MaxDelay
The maximum time delay between retries, must be nonnegative.
Declaration
public TimeSpan MaxDelay { get; init; }
Property Value
Type | Description |
---|---|
TimeSpan |
MaxRetryCount
The number of retry attempts.
Declaration
public int MaxRetryCount { get; init; }
Property Value
Type | Description |
---|---|
int |
RandomFactor
The maximum random factor, must not be lesser than 1.
Declaration
public double RandomFactor { get; init; }
Property Value
Type | Description |
---|---|
double |
RetryPolicy
Retry policy for new DataConnection instance.
Declaration
public IRetryPolicy? RetryPolicy { get; init; }
Property Value
Type | Description |
---|---|
IRetryPolicy |
Methods
| Improve this Doc View SourceEquals(RetryPolicyOptions?)
Declaration
public bool Equals(RetryPolicyOptions? other)
Parameters
Type | Name | Description |
---|---|---|
RetryPolicyOptions | other |
Returns
Type | Description |
---|---|
bool |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int |