public bool CanRetry(Exception exception, out RetryContext <ConsumeContext> retryContext) { var canRetry = _policyContext.CanRetry(exception, out RetryContext <ConsumeContext> policyRetryContext); if (canRetry) { _context.LogRetry(exception); _registration = _cancellationToken.Register(Cancel); } retryContext = new ConsumeContextRetryContext(policyRetryContext, canRetry ? _context.CreateNext(policyRetryContext) : _context); return(canRetry); }
public bool CanRetry(Exception exception, out RetryContext <ConsumeContext> retryContext) { var canRetry = _policyContext.CanRetry(exception, out RetryContext <ConsumeContext> policyRetryContext); if (canRetry) { _context.LogRetry(exception); } retryContext = new ConsumeContextRetryContext(policyRetryContext, canRetry ? _context.CreateNext() : _context); return(canRetry); }