In-memory ETS-based 3-state circuit breaker.
States: closed → open → half-open → closed
- Closed: Normal operation, requests pass through
- Open: Failing, requests are rejected immediately
- Half-open: Testing if service recovered
Usage
LLMUtils.CircuitBreaker.call(:my_service, fn -> my_request() end)Override by passing a module implementing call/3 in Client options.
Summary
Functions
Execute a function with circuit breaking.