Class: EventMachine::CircuitBreaker::Breaker
- Inherits:
-
Object
- Object
- EventMachine::CircuitBreaker::Breaker
- Defined in:
- lib/eventmachine/circuit_breaker/breaker.rb
Instance Method Summary collapse
-
#initialize(strategy = Strategy::Basic.new) ⇒ Breaker
constructor
A new instance of Breaker.
- #request(client, headers, body) ⇒ Object
- #response(client) ⇒ Object
Constructor Details
Instance Method Details
#request(client, headers, body) ⇒ Object
8 9 10 11 |
# File 'lib/eventmachine/circuit_breaker/breaker.rb', line 8 def request(client, headers, body) close!(client) if strategy.open? [headers, body] end |
#response(client) ⇒ Object
13 14 15 16 |
# File 'lib/eventmachine/circuit_breaker/breaker.rb', line 13 def response(client) strategy.handle_response(client) close!(client) if strategy.open? end |