Class: Hystrix::CommandExecutor
- Inherits:
-
Object
- Object
- Hystrix::CommandExecutor
- Defined in:
- lib/hystrix/executor_pool.rb
Instance Attribute Summary collapse
-
#owner ⇒ Object
Returns the value of attribute owner.
Instance Method Summary collapse
-
#initialize ⇒ CommandExecutor
constructor
A new instance of CommandExecutor.
- #lock ⇒ Object
- #locked? ⇒ Boolean
- #run(command) ⇒ Object
- #unlock ⇒ Object
Constructor Details
#initialize ⇒ CommandExecutor
Returns a new instance of CommandExecutor.
76 77 78 |
# File 'lib/hystrix/executor_pool.rb', line 76 def initialize self.owner = nil end |
Instance Attribute Details
#owner ⇒ Object
Returns the value of attribute owner.
74 75 76 |
# File 'lib/hystrix/executor_pool.rb', line 74 def owner @owner end |
Instance Method Details
#lock ⇒ Object
80 81 82 |
# File 'lib/hystrix/executor_pool.rb', line 80 def lock self.owner = Thread.current end |
#locked? ⇒ Boolean
88 89 90 |
# File 'lib/hystrix/executor_pool.rb', line 88 def locked? !self.owner.nil? end |
#run(command) ⇒ Object
92 93 94 |
# File 'lib/hystrix/executor_pool.rb', line 92 def run(command) command.run end |
#unlock ⇒ Object
84 85 86 |
# File 'lib/hystrix/executor_pool.rb', line 84 def unlock self.owner = nil end |