Module: BreakerMachines::HedgedExecution

Extended by:
ActiveSupport::Concern
Included in:
Circuit
Defined in:
lib/breaker_machines/hedged_execution.rb

Overview

HedgedExecution provides hedged request functionality for circuit breakers Hedged requests improve latency by sending duplicate requests to multiple backends and returning the first successful response

Instance Method Summary collapse

Instance Method Details

#execute_hedgedObject

Execute a hedged request pattern



14
15
16
17
18
# File 'lib/breaker_machines/hedged_execution.rb', line 14

def execute_hedged(&)
  return execute_single_hedged(&) unless @config[:backends]&.any?

  execute_multi_backend_hedged
end