class Sidekiq::CircuitBreaker::Manager
Public Class Methods
new(scope, options)
click to toggle source
# File lib/sidekiq/circuit_breaker/manager.rb, line 7 def initialize(scope, options) @scope = scope @options = options end
Public Instance Methods
closed?()
click to toggle source
# File lib/sidekiq/circuit_breaker/manager.rb, line 21 def closed? !open? end
evaluate_failure()
click to toggle source
# File lib/sidekiq/circuit_breaker/manager.rb, line 12 def evaluate_failure count = register_failure open if count >= @options.failure_threshold end
failure_count()
click to toggle source
# File lib/sidekiq/circuit_breaker/manager.rb, line 25 def failure_count failure_count_for_scope(@scope) end
open()
click to toggle source
# File lib/sidekiq/circuit_breaker/manager.rb, line 29 def open open_circuit(@scope, @options.max_open_time) end
open?()
click to toggle source
# File lib/sidekiq/circuit_breaker/manager.rb, line 17 def open? circuit_open?(@scope) end
register_failure()
click to toggle source
# File lib/sidekiq/circuit_breaker/manager.rb, line 37 def register_failure register_failure_for_scope(@scope) end
register_success()
click to toggle source
# File lib/sidekiq/circuit_breaker/manager.rb, line 45 def register_success register_success_for_scope(@scope) end
time_to_close()
click to toggle source
# File lib/sidekiq/circuit_breaker/manager.rb, line 33 def time_to_close time_to_close_the_circuit(@scope) end