Exemplo n.º 1
0
 /// <summary>
 /// </summary>
 /// <param name="millisecDelayBetweenRetries">Optional delay in milliseconds between retries.</param>
 /// <param name="optionalFailureDetector">Optional custom method to decide whether failure occurred and retry is required. If not provided, exception in the main method or result post-processing will trigger retry.</param>
 protected RetryAspectBase(uint millisecDelayBetweenRetries, FailureDetectorDelegate optionalFailureDetector)
 {
     this.MillisecDelayBetweenRetries = millisecDelayBetweenRetries;
     this.OptionalFailureDetector     = optionalFailureDetector;
 }
Exemplo n.º 2
0
 /// <summary>
 /// </summary>
 /// <param name="keepTryingForMilliseconds">Time period during which attempts will be made to call intercepted method.</param>
 /// <param name="millisecDelayBetweenRetries"></param>
 /// <param name="optionalFailureDetector">Optional custom method to decide whether failure occurred and retry is required. If not provided, exception in the main method or result post-processing will trigger retry.</param>
 public RetryTimeAspect(uint keepTryingForMilliseconds, uint millisecDelayBetweenRetries = 0, FailureDetectorDelegate optionalFailureDetector = null)
     : base(millisecDelayBetweenRetries, optionalFailureDetector)
 {
     this.KeepTryingForMilliseconds = keepTryingForMilliseconds;
 }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="keepTryingForMilliseconds">Maximum amount of time to keep retrying for, after which failure is considered permanent.</param>
        /// <param name="initialMillisecDelayBetweenRetries">Delay after first failed attempt. Delay between subsequent attempts will grow.</param>
        /// <param name="delayMultiplier">Multiplier determining growth of delay between subsequent attempts.</param>
        /// <param name="optionalFailureDetector">Optional custom method to decide whether failure occurred and retry is required. If not provided, exception in the main method or result post-processing will trigger retry.</param>
        public RetryExponentialDelayAspect(uint keepTryingForMilliseconds, uint initialMillisecDelayBetweenRetries = 1, double delayMultiplier = 2.0, FailureDetectorDelegate optionalFailureDetector = null)
            : base(keepTryingForMilliseconds, initialMillisecDelayBetweenRetries == 0 ? 1 : initialMillisecDelayBetweenRetries, optionalFailureDetector)
        {
            if (delayMultiplier <= 1)
            {
                throw new ArgumentException("delayMultiplier has to be greater than 1. {0} is an invalid value.".SmartFormat(delayMultiplier));
            }

            this.DelayMultiplier = delayMultiplier;
        }
Exemplo n.º 4
0
 /// <summary>
 /// </summary>
 /// <param name="retryCount">Maximum number of attempts to call the function</param>
 /// <param name="millisecDelayBetweenRetries"></param>
 /// <param name="optionalFailureDetector">Optional custom method to decide whether failure occurred and retry is required. If not provided, exception in the main method or result post-processing will trigger retry.</param>
 public RetryCountAspect(byte retryCount, uint millisecDelayBetweenRetries = 0, FailureDetectorDelegate optionalFailureDetector = null)
     : base(millisecDelayBetweenRetries, optionalFailureDetector)
 {
     this.RetryCount = retryCount;
 }
Exemplo n.º 5
0
 /// <summary>
 /// </summary>
 /// <param name="millisecDelayBetweenRetries">Optional delay in milliseconds between retries.</param>
 /// <param name="optionalFailureDetector">Optional custom method to decide whether failure occurred and retry is required. If not provided, exception in the main method or result post-processing will trigger retry.</param>
 protected RetryAspectBase(uint millisecDelayBetweenRetries, FailureDetectorDelegate optionalFailureDetector)
 {
     this.MillisecDelayBetweenRetries = millisecDelayBetweenRetries;
     this.OptionalFailureDetector = optionalFailureDetector;
 }
Exemplo n.º 6
0
 /// <summary>
 /// </summary>
 /// <param name="keepTryingForMilliseconds">Time period during which attempts will be made to call intercepted method.</param>
 /// <param name="millisecDelayBetweenRetries"></param>
 /// <param name="optionalFailureDetector">Optional custom method to decide whether failure occurred and retry is required. If not provided, exception in the main method or result post-processing will trigger retry.</param>
 public RetryTimeAspect(uint keepTryingForMilliseconds, uint millisecDelayBetweenRetries = 0, FailureDetectorDelegate optionalFailureDetector = null)
     : base(millisecDelayBetweenRetries, optionalFailureDetector)
 {
     this.KeepTryingForMilliseconds = keepTryingForMilliseconds;
 }
Exemplo n.º 7
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="keepTryingForMilliseconds">Maximum amount of time to keep retrying for, after which failure is considered permanent.</param>
        /// <param name="initialMillisecDelayBetweenRetries">Delay after first failed attempt. Delay between subsequent attempts will grow.</param>
        /// <param name="delayMultiplier">Multiplier determining growth of delay between subsequent attempts.</param>
        /// <param name="optionalFailureDetector">Optional custom method to decide whether failure occurred and retry is required. If not provided, exception in the main method or result post-processing will trigger retry.</param>
        public RetryExponentialDelayAspect(uint keepTryingForMilliseconds, uint initialMillisecDelayBetweenRetries = 1, double delayMultiplier = 2.0, FailureDetectorDelegate optionalFailureDetector = null)
            : base(keepTryingForMilliseconds, initialMillisecDelayBetweenRetries == 0 ? 1 : initialMillisecDelayBetweenRetries, optionalFailureDetector)
        {
            if(delayMultiplier <= 1)
                throw new ArgumentException("delayMultiplier has to be greater than 1. {0} is an invalid value.".SmartFormat(delayMultiplier));

            this.DelayMultiplier = delayMultiplier;
        }
Exemplo n.º 8
0
 /// <summary>
 /// </summary>
 /// <param name="retryCount">Maximum number of attempts to call the function</param>
 /// <param name="millisecDelayBetweenRetries"></param>
 /// <param name="optionalFailureDetector">Optional custom method to decide whether failure occurred and retry is required. If not provided, exception in the main method or result post-processing will trigger retry.</param>
 public RetryCountAspect(byte retryCount, uint millisecDelayBetweenRetries = 0, FailureDetectorDelegate optionalFailureDetector = null)
     : base(millisecDelayBetweenRetries, optionalFailureDetector)
 {
     this.RetryCount = retryCount;
 }