Build a Circuit Breaker

closed/open/half-open state machine

Challenge 4 of Traffic & ResilienceIntermediate~55 min

Stop hammering a failing dependency. Build the Closed → Open → Half-Open state machine that trips after repeated failures, fails fast while open, probes for recovery after a timeout, and wraps calls end to end.

5 steps

  1. 1Closed State & Tripping
  2. 2Fail Fast When Open
  3. 3Probing with Half-Open
  4. 4Recovery and Re-tripping
  5. 5Wrapping a Call
Start step 1