Amazon.DynamoDBv2.Internal.DynamoDBRetryPolicy.WaitBeforeRetry C# (CSharp) Method

WaitBeforeRetry() public method

Overriden to cause a pause between retries.
public WaitBeforeRetry ( IExecutionContext executionContext ) : void
executionContext IExecutionContext
return void
        public override void WaitBeforeRetry(IExecutionContext executionContext)
        {
            pauseExponentially(executionContext.RequestContext.Retries);
        }

Usage Example

Beispiel #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);
            }
        }