Packages

Prevent cascading failures in your Gleam applications. Circuit breaker pattern with sliding window tracking, OTP-supervised state, and support for both Erlang and JavaScript targets.

Current section

Files

Jump to
circuit src circuit.gleam
Raw

src/circuit.gleam

pub type CircuitState {
Closed
Open
HalfOpen
}
pub type Config {
Config(failure_threshold: Int, window_size: Int, reset_timeout: Int)
}
pub type CallResult {
Success
Failure(reason: String)
}