Circuit Breaker
A service that calls a remote dependency wraps the call in a circuit breaker. After a threshold of failures, the breaker trips OPEN and short-circuits subsequent calls — they fail immediately without hitting the network.…
$ prime install @backend-architecture/pattern-circuit-breaker Projection
Always in _index.xml · the agent never has to ask for this.
CircuitBreaker [pattern] v1.0.0
A service that calls a remote dependency wraps the call in a circuit breaker. After a threshold of failures, the breaker trips OPEN and short-circuits subsequent calls — they fail immediately without hitting the network. After a cool-down it goes HALF-OPEN to probe; on success it CLOSES, on failure it re-OPENS. This prevents a cascade where one slow downstream consumes all callers' threads.
Loaded when retrieval picks the atom as adjacent / supporting.
CircuitBreaker [pattern] v1.0.0
A service that calls a remote dependency wraps the call in a circuit breaker. After a threshold of failures, the breaker trips OPEN and short-circuits subsequent calls — they fail immediately without hitting the network. After a cool-down it goes HALF-OPEN to probe; on success it CLOSES, on failure it re-OPENS. This prevents a cascade where one slow downstream consumes all callers' threads.
Label
Circuit Breaker — fail fast on a downstream that is already failing
Problem
Service A calls Service B synchronously. B becomes slow (5s timeouts). A's request threads pile up waiting on B. Soon every A thread is blocked on B, and A becomes unavailable to all callers. The failure has cascaded.
Solution
Wrap the remote call in a circuit-breaker library (Resilience4j, Polly, Hystrix-equivalent).
State machine:
CLOSED → calls flow through; failures counted in a sliding window.
OPEN → after N failures within W seconds, trip. New calls fail immediately
with CircuitBreakerOpenException.
HALF-OPEN → after cool-down T, allow one probe. Success → CLOSED. Failure → OPEN.
Pair with a fallback: cached response, default value, or graceful degradation.
Loaded when retrieval picks the atom as a focal / direct hit.
CircuitBreaker [pattern] v1.0.0
A service that calls a remote dependency wraps the call in a circuit breaker. After a threshold of failures, the breaker trips OPEN and short-circuits subsequent calls — they fail immediately without hitting the network. After a cool-down it goes HALF-OPEN to probe; on success it CLOSES, on failure it re-OPENS. This prevents a cascade where one slow downstream consumes all callers' threads.
Label
Circuit Breaker — fail fast on a downstream that is already failing
Problem
Service A calls Service B synchronously. B becomes slow (5s timeouts). A's request threads pile up waiting on B. Soon every A thread is blocked on B, and A becomes unavailable to all callers. The failure has cascaded.
Solution
Wrap the remote call in a circuit-breaker library (Resilience4j, Polly, Hystrix-equivalent).
State machine:
CLOSED → calls flow through; failures counted in a sliding window.
OPEN → after N failures within W seconds, trip. New calls fail immediately
with CircuitBreakerOpenException.
HALF-OPEN → after cool-down T, allow one probe. Success → CLOSED. Failure → OPEN.
Pair with a fallback: cached response, default value, or graceful degradation.
Relations
enhances: [@backend-architecture/principle-disposability]
Label
Circuit Breaker — fail fast on a downstream that is already failing
Problem
Service A calls Service B synchronously. B becomes slow (5s timeouts). A's request threads pile up waiting on B. Soon every A thread is blocked on B, and A becomes unavailable to all callers. The failure has cascaded.
Solution
Wrap the remote call in a circuit-breaker library (Resilience4j, Polly, Hystrix-equivalent).
State machine:
CLOSED → calls flow through; failures counted in a sliding window.
OPEN → after N failures within W seconds, trip. New calls fail immediately
with CircuitBreakerOpenException.
HALF-OPEN → after cool-down T, allow one probe. Success → CLOSED. Failure → OPEN.
Pair with a fallback: cached response, default value, or graceful degradation.
Enhances
- @backend-architecture/principle-disposability
Source
prime-system/examples/backend-architecture/primes/compiled/@backend-architecture/pattern-circuit-breaker/atom.yaml