Class: Hystrix::InlineCommand
Instance Attribute Summary
Attributes inherited from Command
Instance Method Summary collapse
- #fallback(error) ⇒ Object
-
#initialize(executor_pool_name, run_block, fallback_block) ⇒ InlineCommand
constructor
A new instance of InlineCommand.
- #run ⇒ Object
Methods inherited from Command
default_pool_size, #execute, #executor_pool_name, pool_size, #queue
Constructor Details
#initialize(executor_pool_name, run_block, fallback_block) ⇒ InlineCommand
Returns a new instance of InlineCommand.
29 30 31 32 33 34 |
# File 'lib/hystrix/inline.rb', line 29 def initialize(executor_pool_name, run_block, fallback_block) @run_block = run_block @fallback_block = fallback_block @executor_pool_name = executor_pool_name super end |
Instance Method Details
#fallback(error) ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/hystrix/inline.rb', line 40 def fallback(error) if @fallback_block @fallback_block.yield(error) else raise NotImplementedError end end |
#run ⇒ Object
36 37 38 |
# File 'lib/hystrix/inline.rb', line 36 def run @run_block.yield end |