public Task ConsumeFault <T>(ConsumeContext <T> context, Exception exception) where T : class { if (_killSwitch.ExceptionFilter.Match(exception)) { _killSwitch.Stop(_exception, this); } return(TaskUtil.Completed); }
public async Task ConsumeFault <T>(ConsumeContext <T> context, Exception exception) where T : class { if (_killSwitch.ExceptionFilter.Match(exception)) { var failureCount = Interlocked.Increment(ref _failureCount); if (IsActive && TripThresholdExceeded(failureCount)) { _killSwitch.Stop(exception, this); _timer?.Dispose(); } } }