Class: Circuitbox
- Inherits:
-
Object
- Object
- Circuitbox
- Extended by:
- Configuration
- Defined in:
- lib/circuitbox.rb,
lib/circuitbox/version.rb,
lib/circuitbox/errors/error.rb,
lib/circuitbox/memory_store.rb,
lib/circuitbox/configuration.rb,
lib/circuitbox/notifier/null.rb,
lib/circuitbox/circuit_breaker.rb,
lib/circuitbox/excon_middleware.rb,
lib/circuitbox/time_helper/real.rb,
lib/circuitbox/faraday_middleware.rb,
lib/circuitbox/time_helper/monotonic.rb,
lib/circuitbox/memory_store/container.rb,
lib/circuitbox/notifier/active_support.rb,
lib/circuitbox/errors/open_circuit_error.rb,
lib/circuitbox/errors/service_failure_error.rb
Defined Under Namespace
Modules: Configuration, Notifier, TimeHelper Classes: CircuitBreaker, Error, ExconMiddleware, FaradayMiddleware, MemoryStore, OpenCircuitError, ServiceFailureError
Constant Summary collapse
- VERSION =
'2.0.0'
Instance Attribute Summary
Attributes included from Configuration
#default_circuit_store, #default_notifier
Class Method Summary collapse
Methods included from Configuration
Class Method Details
.circuit(service_name, options = {}) ⇒ Circuitbox::CircuitBreaker .circuit(service_name, options = {}, &block) ⇒ Object?
36 37 38 39 40 41 42 |
# File 'lib/circuitbox.rb', line 36 def circuit(service_name, , &block) circuit = find_or_create_circuit_breaker(service_name, ) return circuit unless block circuit.run(exception: false, &block) end |