Module: HTTPX::Plugins::CircuitBreaker

Defined in:
lib/httpx/plugins/circuit_breaker.rb,
lib/httpx/plugins/circuit_breaker/circuit.rb,
lib/httpx/plugins/circuit_breaker/circuit_store.rb

Overview

This plugin implements a circuit breaker around connection errors.

gitlab.com/os85/httpx/wikis/Circuit-Breaker

Defined Under Namespace

Modules: InstanceMethods, OptionsMethods Classes: Circuit, CircuitStore

Class Method Summary collapse

Class Method Details

.extra_options(options) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/httpx/plugins/circuit_breaker.rb', line 18

def self.extra_options(options)
  options.merge(
    circuit_breaker_max_attempts: 3,
    circuit_breaker_reset_attempts_in: 60,
    circuit_breaker_break_in: 60,
    circuit_breaker_half_open_drip_rate: 1
  )
end

.load_dependenciesObject



13
14
15
16
# File 'lib/httpx/plugins/circuit_breaker.rb', line 13

def self.load_dependencies(*)
  require_relative "circuit_breaker/circuit"
  require_relative "circuit_breaker/circuit_store"
end