Class: AllMyCircuits::Strategies::AbstractStrategy
- Inherits:
-
Object
- Object
- AllMyCircuits::Strategies::AbstractStrategy
- Defined in:
- lib/all_my_circuits/strategies/abstract_strategy.rb
Overview
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.
Direct Known Subclasses
Instance Method Summary collapse
-
#closed ⇒ Object
Public: called whenever circuit is closed.
-
#error ⇒ Object
Public: called whenever a request has failed within circuit breaker.
-
#opened ⇒ Object
Public: called whenever circuit is tripped open.
-
#should_open? ⇒ Boolean
Public: called after each error within circuit breaker to determine whether it should be tripped open.
-
#success ⇒ Object
Public: called whenever a request has ran successfully through circuit breaker.
Instance Method Details
#closed ⇒ Object
Public: called whenever circuit is closed.
28 29 |
# File 'lib/all_my_circuits/strategies/abstract_strategy.rb', line 28 def closed end |
#error ⇒ Object
Public: called whenever a request has failed within circuit breaker.
18 19 |
# File 'lib/all_my_circuits/strategies/abstract_strategy.rb', line 18 def error end |
#opened ⇒ Object
Public: called whenever circuit is tripped open.
23 24 |
# File 'lib/all_my_circuits/strategies/abstract_strategy.rb', line 23 def opened end |
#should_open? ⇒ Boolean
Public: called after each error within circuit breaker to determine whether it should be tripped open.
34 35 36 |
# File 'lib/all_my_circuits/strategies/abstract_strategy.rb', line 34 def should_open? raise NotImplementedError end |
#success ⇒ Object
Public: called whenever a request has ran successfully through circuit breaker.
13 14 |
# File 'lib/all_my_circuits/strategies/abstract_strategy.rb', line 13 def success end |