class AllMyCircuits::Strategies::AbstractStrategy
Public: determines whether the circuit breaker should be tripped open upon another error within the supplied block.
See AllMyCircuits::Strategies::NumberOverWindowStrategy
, AllMyCircuits::Strategies::PercentageOverWindowStrategy
for examples.
Public Instance Methods
closed()
click to toggle source
Public: called whenever circuit is closed.
# File lib/all_my_circuits/strategies/abstract_strategy.rb, line 28 def closed end
error()
click to toggle source
Public: called whenever a request has failed within circuit breaker.
# File lib/all_my_circuits/strategies/abstract_strategy.rb, line 18 def error end
opened()
click to toggle source
Public: called whenever circuit is tripped open.
# File lib/all_my_circuits/strategies/abstract_strategy.rb, line 23 def opened end
should_open?()
click to toggle source
Public: called after each error within circuit breaker to determine whether it should be tripped open.
# File lib/all_my_circuits/strategies/abstract_strategy.rb, line 34 def should_open? raise NotImplementedError end
success()
click to toggle source
Public: called whenever a request has ran successfully through circuit breaker.
# File lib/all_my_circuits/strategies/abstract_strategy.rb, line 13 def success end