示例#1
0
        public void RetryTimeoutFailed()
        {
            RetryPolicy rp       = new RetryPolicy(5, new FixedWaitingPolicy(TimeSpan.FromMilliseconds(10)), AllErrorsTransientDetectionStrategy.Instance);
            int         attempts = 0;

            rp.ExecuteWithRetries(() =>
            {
                attempts++;
                throw new OperationCanceledException();
            });
        }
示例#2
0
        public void RetryNullOperationT()
        {
            RetryPolicy rp = new RetryPolicy <string>(5, new FixedWaitingPolicy(TimeSpan.FromMilliseconds(10)), AllErrorsTransientDetectionStrategy <string> .Instance);

            rp.ExecuteWithRetries(null);
        }