Microservices - Resilience Patterns
Given this pseudocode snippet, what will be the output if the circuit breaker is CLOSED and the service call fails twice?
breaker = CircuitBreaker(state='CLOSED', failureCount=0, failureThreshold=3)
for i in range(2):
try:
call_service()
except:
breaker.failureCount += 1
if breaker.failureCount >= breaker.failureThreshold:
breaker.state = 'OPEN'
print(breaker.state)