Class RetryPolicyOptions
- Namespace
- LinqToDB.Data.RetryPolicy
- Assembly
- linq2db.dll
public sealed record RetryPolicyOptions : IOptionSet, IConfigurationID, IEquatable<RetryPolicyOptions>
- Inheritance
-
objectRetryPolicyOptions
- Implements
- 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
RetryPolicyIRetryPolicyRetry policy for new DataConnection instance.
FactoryFunc<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.
MaxRetryCountintThe number of retry attempts.
MaxDelayTimeSpanThe maximum time delay between retries, must be nonnegative.
RandomFactordoubleThe maximum random factor, must not be lesser than 1.
ExponentialBasedoubleThe base for the exponential function used to compute the delay between retries, must not be lesser than 1.
CoefficientTimeSpanThe 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
Default
Gets default RetryPolicyOptions instance.
public static RetryPolicyOptions Default { get; set; }
Property Value
ExponentialBase
The base for the exponential function used to compute the delay between retries, must not be lesser than 1.
public double ExponentialBase { get; init; }
Property Value
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
MaxDelay
The maximum time delay between retries, must be nonnegative.
public TimeSpan MaxDelay { get; init; }
Property Value
MaxRetryCount
The number of retry attempts.
public int MaxRetryCount { get; init; }
Property Value
RandomFactor
The maximum random factor, must not be lesser than 1.
public double RandomFactor { get; init; }
Property Value
RetryPolicy
Retry policy for new DataConnection instance.
public IRetryPolicy? RetryPolicy { get; init; }
Property Value
Methods
Equals(RetryPolicyOptions?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(RetryPolicyOptions? other)
Parameters
otherRetryPolicyOptionsAn object to compare with this object.
Returns
- bool
true if the current object is equal to the
otherparameter; otherwise, false.
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.