Open grr89 opened 9 years ago
The code sets up a new threshold breaker configured to trip after 3 unsuccessful calls. The code above only calls,and fails, once. The circuit breaker still has 2 remaining unsuccessful calls to go before tripping. So the last line prints that the circuit isn't tripped after 1 call. I'd say this is expected behavior.
Change the example to fail 2 more times and then print the state again. It should be tripped at that point.
Output: called 1 times tripped: false err:dial tcp 127.0.0.1:4000: connection refused