Class: Hiatus::Circuits::PercentageCircuitBreaker
- Inherits:
-
Hiatus::CircuitBreaker
- Object
- Hiatus::CircuitBreaker
- Hiatus::Circuits::PercentageCircuitBreaker
- Defined in:
- lib/hiatus/circuits/percentage_circuit_breaker.rb
Constant Summary
Constants inherited from Hiatus::CircuitBreaker
Hiatus::CircuitBreaker::DEFAULT_THRESHOLD, Hiatus::CircuitBreaker::DEFAUTS
Instance Attribute Summary
Attributes inherited from Hiatus::CircuitBreaker
Instance Method Summary collapse
-
#initialize(threshold: nil, half_open_interval: nil) ⇒ PercentageCircuitBreaker
constructor
A new instance of PercentageCircuitBreaker.
Methods inherited from Hiatus::CircuitBreaker
#call_with_circuit_state_changes, #close, #closed?, #half_open?, #increment_failure_count, #increment_failure_count_and_trip_if_threshold_exceeded, #open?, #run, #trip_if_threshold_exceeded
Constructor Details
#initialize(threshold: nil, half_open_interval: nil) ⇒ PercentageCircuitBreaker
Returns a new instance of PercentageCircuitBreaker.
4 5 6 7 |
# File 'lib/hiatus/circuits/percentage_circuit_breaker.rb', line 4 def initialize(threshold: nil, half_open_interval: nil) threshold = Hiatus::PercentageThreshold.new threshold super threshold: threshold, half_open_interval: half_open_interval end |