The default implementation of the retry policy.
Inheritance: RetryPolicy
Ejemplo n.º 1
0
        public void TestLargeRetryCount()
        {
            var maxRetries = 1000;
            var maxMilliseconds = 1;

            var coreRetryPolicy = new DefaultRetryPolicy(100)
            {
                MaxBackoffInMilliseconds = maxMilliseconds
            };
            var ddbRetryPolicy = new DynamoDBRetryPolicy(100)
            {
                MaxBackoffInMilliseconds = maxMilliseconds
            };

            var context = new ExecutionContext(new RequestContext(false), null);
            for (int i = 0; i < maxRetries; i++)
            {
                context.RequestContext.Retries = i;
                coreRetryPolicy.WaitBeforeRetry(context);
                ddbRetryPolicy.WaitBeforeRetry(context);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Waits before retrying a request. The default policy implements a exponential backoff.
 /// </summary>
 /// <param name="executionContext">Request context containing the state of the request.</param>
 public override void WaitBeforeRetry(IExecutionContext executionContext)
 {
     DefaultRetryPolicy.WaitBeforeRetry(executionContext.RequestContext.Retries, this.MaxBackoffInMilliseconds);
 }