class

Fetcher::CircuitBreaker

Inherits Reference < Object

Constants

DEFAULT_TTL = 5.minutes

Constructors

new(failure_threshold : Int32 = 5, recovery_timeout : Time::Span = 60.seconds)
Source

Instance methods

allow_request?
Source
failure_count
Source
failure_threshold
Source
last_failure_time

A monotonic instant (Time::Instant) from Time.instant -- safe against NTP/suspend jumps. Wall-clock (Time.utc) would miscalculate the recovery window if the system clock jumped.

Source
last_failure_time=(last_failure_time : Time::Instant | Nil)

A monotonic instant (Time::Instant) from Time.instant -- safe against NTP/suspend jumps. Wall-clock (Time.utc) would miscalculate the recovery window if the system clock jumped.

Source
record_failure
Source
record_success
Source
recovery_timeout
Source
state
Source

Nested types