Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="IntuitRetryPolicy"/> class.
        /// </summary>
        /// <param name="retryCount">The number of retry attempts.</param>
        /// <param name="retryInterval">The time interval between retries.</param>
        public IntuitRetryPolicy(int retryCount, TimeSpan retryInterval)
        {
            IntuitRetryHelper.ArgumentNotNegativeValue(retryCount, "retryCount");
            IntuitRetryHelper.ArgumentNotNegativeValue(retryInterval.Ticks, "retryInterval");

            this.retryCount    = retryCount;
            this.retryInterval = retryInterval;
            this.shouldRetry   = this.GetShouldFixedRetry();
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="IntuitRetryPolicy"/> class.
        /// </summary>
        /// <param name="retryCount">The number of retry attempts.</param>
        /// <param name="initialInterval">The initial interval that will apply for the first retry.</param>
        /// <param name="increment">The incremental time value that will be used for calculating the progressive delay between retries.</param>
        public IntuitRetryPolicy(int retryCount, TimeSpan initialInterval, TimeSpan increment)
        {
            IntuitRetryHelper.ArgumentNotNegativeValue(retryCount, "retryCount");
            IntuitRetryHelper.ArgumentNotNegativeValue(initialInterval.Ticks, "initialInterval");
            IntuitRetryHelper.ArgumentNotNegativeValue(increment.Ticks, "increment");

            this.retryCount      = retryCount;
            this.initialInterval = initialInterval;
            this.increment       = increment;
            this.shouldRetry     = this.GetShouldIncrementalRetry();
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="IntuitRetryPolicy"/> class.
        /// </summary>
        /// <param name="retryCount">The maximum number of retry attempts.</param>
        /// <param name="minBackoff">The minimum back-off time</param>
        /// <param name="maxBackoff">The maximum back-off time.</param>
        /// <param name="deltaBackoff">The value which will be used to calculate a random delta in the exponential delay between retries.</param>
        public IntuitRetryPolicy(int retryCount, TimeSpan minBackoff, TimeSpan maxBackoff, TimeSpan deltaBackoff)
        {
            IntuitRetryHelper.ArgumentNotNegativeValue(retryCount, "retryCount");
            IntuitRetryHelper.ArgumentNotNegativeValue(minBackoff.Ticks, "minBackoff");
            IntuitRetryHelper.ArgumentNotNegativeValue(maxBackoff.Ticks, "maxBackoff");
            IntuitRetryHelper.ArgumentNotNegativeValue(deltaBackoff.Ticks, "deltaBackoff");
            IntuitRetryHelper.ArgumentNotGreaterThan(minBackoff.TotalMilliseconds, maxBackoff.TotalMilliseconds, "minBackoff");

            this.retryCount   = retryCount;
            this.minBackOff   = minBackoff;
            this.maxBackOff   = maxBackoff;
            this.deltaBackOff = deltaBackoff;
            this.shouldRetry  = this.GetShouldExponentialBackOffRetry();
        }