Rsft.EntLib.TransientFaultHandling.Standard by Rolosoft Ltd

<PackageReference Include="Rsft.EntLib.TransientFaultHandling.Standard" Version="7.0.0" />


public abstract class RetryStrategy
Represents a retry strategy that determines the number of retry attempts and the interval between retries.
using System; namespace Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling { public abstract class RetryStrategy { public static readonly int DefaultClientRetryCount = 10; public static readonly TimeSpan DefaultClientBackoff = TimeSpan.FromSeconds(10); public static readonly TimeSpan DefaultMaxBackoff = TimeSpan.FromSeconds(30); public static readonly TimeSpan DefaultMinBackoff = TimeSpan.FromSeconds(1); public static readonly TimeSpan DefaultRetryInterval = TimeSpan.FromSeconds(1); public static readonly TimeSpan DefaultRetryIncrement = TimeSpan.FromSeconds(1); public static readonly bool DefaultFirstFastRetry = true; private static RetryStrategy noRetry = new FixedInterval(0, DefaultRetryInterval); private static RetryStrategy defaultFixed = new FixedInterval(DefaultClientRetryCount, DefaultRetryInterval); private static RetryStrategy defaultProgressive = new Incremental(DefaultClientRetryCount, DefaultRetryInterval, DefaultRetryIncrement); private static RetryStrategy defaultExponential = new ExponentialBackoff(DefaultClientRetryCount, DefaultMinBackoff, DefaultMaxBackoff, DefaultClientBackoff); public static RetryStrategy NoRetry => noRetry; public static RetryStrategy DefaultFixed => defaultFixed; public static RetryStrategy DefaultProgressive => defaultProgressive; public static RetryStrategy DefaultExponential => defaultExponential; public bool FastFirstRetry { get; set; } public string Name { get; set; } protected RetryStrategy(string name, bool firstFastRetry) { Name = name; FastFirstRetry = firstFastRetry; } public abstract ShouldRetry GetShouldRetry(); } }