Class: Hystrix::Configuration
- Inherits:
-
Object
- Object
- Hystrix::Configuration
- Defined in:
- lib/hystrix/configuration.rb
Class Method Summary collapse
- .notify_failure(command_name, duration, error) ⇒ Object
- .notify_fallback(command_name, duration, error) ⇒ Object
- .notify_success(command_name, duration) ⇒ Object
- .on_failure(&block) ⇒ Object
- .on_fallback(&block) ⇒ Object
- .on_success(&block) ⇒ Object
- .reset ⇒ Object
Class Method Details
.notify_failure(command_name, duration, error) ⇒ Object
24 25 26 27 28 |
# File 'lib/hystrix/configuration.rb', line 24 def self.notify_failure(command_name, duration, error) if @on_failure @on_failure.call(command_name, duration, error) end end |
.notify_fallback(command_name, duration, error) ⇒ Object
15 16 17 18 19 |
# File 'lib/hystrix/configuration.rb', line 15 def self.notify_fallback(command_name, duration, error) if @on_fallback @on_fallback.call(command_name, duration, error) end end |
.notify_success(command_name, duration) ⇒ Object
6 7 8 9 10 |
# File 'lib/hystrix/configuration.rb', line 6 def self.notify_success(command_name, duration) if @on_success @on_success.call(command_name, duration) end end |
.on_failure(&block) ⇒ Object
21 22 23 |
# File 'lib/hystrix/configuration.rb', line 21 def self.on_failure(&block) @on_failure = block end |
.on_fallback(&block) ⇒ Object
12 13 14 |
# File 'lib/hystrix/configuration.rb', line 12 def self.on_fallback(&block) @on_fallback = block end |
.on_success(&block) ⇒ Object
3 4 5 |
# File 'lib/hystrix/configuration.rb', line 3 def self.on_success(&block) @on_success = block end |
.reset ⇒ Object
30 31 32 33 34 |
# File 'lib/hystrix/configuration.rb', line 30 def self.reset @on_success = nil @on_fallback = nil @on_failure = nil end |