示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RetryPolicy" /> class with the specified number of retry attempts and parameters defining the progressive delay between retries.
        /// </summary>
        /// <param name="errorDetectionStrategy">The <see cref="ITransientErrorDetectionStrategy" /> that is responsible for detecting transient conditions.</param>
        /// <param name="retryStrategy">The strategy to use for this retry policy.</param>
        public RetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, RetryStrategy retryStrategy)
        {
            if (errorDetectionStrategy == null)
            {
                throw Error.ArgumentNull("errorDetectionStrategy");
            }

            if (retryStrategy == null)
            {
                throw Error.ArgumentNull("retryPolicy");
            }

            this.ErrorDetectionStrategy = errorDetectionStrategy;
            this.RetryStrategy          = retryStrategy;
        }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RetryPolicy{T}" /> class with the specified number of retry attempts and parameters defining the progressive delay between retries.
 /// </summary>
 /// <param name="retryStrategy">The strategy to use for this retry policy.</param>
 public RetryPolicy(RetryStrategy retryStrategy)
     : base(CreateStrategy(), retryStrategy)
 {
 }