RubyGems Navigation menu

circuit_breaker 1.1.1

CircuitBreaker is a relatively simple Ruby mixin that will wrap a call to a given service in a circuit breaker pattern. The circuit starts off "closed" meaning that all calls will go through. However, consecutive failures are recorded and after a threshold is reached, the circuit will "trip", setting the circuit into an "open" state. In an "open" state, every call to the service will fail by raising CircuitBrokenException. The circuit will remain in an "open" state until the failure timeout has elapsed. After the failure_timeout has elapsed, the circuit will go into a "half open" state and the call will go through. A failure will immediately pop the circuit open again, and a success will close the circuit and reset the failure count. require 'circuit_breaker' class TestService include CircuitBreaker def call_remote_service() ... circuit_method :call_remote_service # Optional circuit_handler do |handler| handler.logger = Logger.new(STDOUT) handler.failure_threshold = 5 handler.failure_timeout = 5 end # Optional circuit_handler_class MyCustomCircuitHandler end

Gemfile:
= 複製 已複製

安裝:
=

版本列表:

  1. 1.1.2 - January 11, 2016 (11.0 KB)
  2. 1.1.1 - March 06, 2014 (11.0 KB)
  3. 1.1.0 - April 19, 2013 (9.5 KB)
  4. 1.0.1 - January 05, 2012 (9.5 KB)
  5. 1.0.0 - August 05, 2009 (11.0 KB)

Runtime 相依性套件 (1):

aasm >= 0

Development 相依性套件 (2):

rake >= 0
rspec >= 0

擁有者:

作者:

  • Will Sargent

SHA 256 checksum:

b3e23b5bea9fb3efd5493e3da799d540978f37a609d237702a9740240b9eee19

總下載次數 555,148

這個版本 11,024

License:

Ruby 版本需求:

相關連結: