Microservices - Resilience Patterns
What will be printed by this code snippet?
Assuming
breaker = CircuitBreaker(state='OPEN', failureCount=3, failureThreshold=3) # After timeout breaker.state = 'HALF-OPEN' try: call_service() breaker.state = 'CLOSED' breaker.failureCount = 0 except: breaker.state = 'OPEN' print(breaker.state)
Assuming
call_service() succeeds.