Module: BreakerMachines::Circuit::Execution
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/breaker_machines/circuit/execution.rb
Overview
Execution handles the core circuit breaker logic including call wrapping, state-based request handling, and failure/success tracking.
Class Method Summary collapse
-
.load_async_support ⇒ Object
Lazy load async support only when needed.
Instance Method Summary collapse
Class Method Details
.load_async_support ⇒ Object
Lazy load async support only when needed
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/breaker_machines/circuit/execution.rb', line 11 def self.load_async_support require 'breaker_machines/async_support' require 'breaker_machines/hedged_async_support' Circuit.include(BreakerMachines::AsyncSupport) Circuit.include(BreakerMachines::HedgedAsyncSupport) rescue LoadError => e if e..include?('async') raise LoadError, "The 'async' gem is required for fiber_safe mode. Add `gem 'async'` to your Gemfile." end raise end |
Instance Method Details
#call ⇒ Object
24 25 26 |
# File 'lib/breaker_machines/circuit/execution.rb', line 24 def call(&) wrap(&) end |
#wrap ⇒ Object
28 29 30 |
# File 'lib/breaker_machines/circuit/execution.rb', line 28 def wrap(&) execute_with_state_check(&) end |