public Task Failure(Exception exception)
{
lastException = exception;
var newValue = Interlocked.Increment(ref failureCount);
if (newValue == 1)
{
timer.Change(timeToWaitBeforeTriggering, NoPeriodicTriggering);
Logger.WarnFormat("The circuit breaker for {0} is now in the armed state", name);
}
return Task.Delay(TimeSpan.FromSeconds(1));
}