/// <summary> /// Creates the backoff object /// </summary> /// <param name="config"></param> internal ExponentialBackoff( ExponentialBackoffAndRetryConfig config ) { this.Config = config; // Start at -1 because the first delay is going to add 1 to this, // but that attempt does not count as a retry this.retries = 0; this.exponent = 1; this.previousDelay = this.Config.DelayInMilliseconds; this.rand = new Random(); }
/// <summary> /// Creates the client with the specified config. /// </summary> /// <param name="config"></param> public ExponentialBackoffAndRetryClient(ExponentialBackoffAndRetryConfig config) { this.Config = config ?? throw new ArgumentNullException("config"); }
/// <summary> /// Default constructor that uses the default values for the client /// config. /// </summary> public ExponentialBackoffAndRetryClient() { this.Config = new ExponentialBackoffAndRetryConfig(); }