Module: CircuitBreaker
- Defined in:
- lib/circuit_breaker.rb,
lib/circuit_breaker/version.rb
Defined Under Namespace
Modules: ClassMethods Classes: CircuitBrokenException, CircuitHandler, CircuitState
Constant Summary collapse
- VERSION =
'1.1.2'
Class Method Summary collapse
-
.included(klass) ⇒ Object
Extends the included class with CircuitBreaker.
Instance Method Summary collapse
-
#circuit_state ⇒ Object
Returns the current circuit state.
Class Method Details
.included(klass) ⇒ Object
Extends the included class with CircuitBreaker
58 59 60 |
# File 'lib/circuit_breaker.rb', line 58 def self.included(klass) klass.extend ::CircuitBreaker::ClassMethods end |
Instance Method Details
#circuit_state ⇒ Object
Returns the current circuit state. This is defined on the instance, so you can have several instances of the same class with different states.
66 67 68 |
# File 'lib/circuit_breaker.rb', line 66 def circuit_state @circuit_state ||= self.class.circuit_handler.new_circuit_state end |