Class: Hystrix::CommandExecutor

Inherits:
Object
  • Object
show all
Defined in:
lib/hystrix/executor_pool.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCommandExecutor

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

#ownerObject

Returns the value of attribute owner.



74
75
76
# File 'lib/hystrix/executor_pool.rb', line 74

def owner
  @owner
end

Instance Method Details

#lockObject



80
81
82
# File 'lib/hystrix/executor_pool.rb', line 80

def lock
	self.owner = Thread.current
end

#locked?Boolean

Returns:

  • (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

#unlockObject



84
85
86
# File 'lib/hystrix/executor_pool.rb', line 84

def unlock
	self.owner = nil
end