class JobDispatch::Broker::Command
Attributes
parameters[RW]
worker_id[RW]
Public Class Methods
new(worker_id=nil, parameters=nil)
click to toggle source
# File lib/job_dispatch/broker/command.rb, line 14 def initialize(worker_id=nil, parameters=nil) @worker_id, @parameters = worker_id, parameters end
Public Instance Methods
command()
click to toggle source
# File lib/job_dispatch/broker/command.rb, line 26 def command @parameters[:command] end
queue()
click to toggle source
# File lib/job_dispatch/broker/command.rb, line 22 def queue (@parameters[:queue] || :default).to_sym end
status()
click to toggle source
# File lib/job_dispatch/broker/command.rb, line 30 def status @parameters[:status] && @parameters[:status].to_sym end
success?()
click to toggle source
# File lib/job_dispatch/broker/command.rb, line 34 def success? status == :success end
worker_name()
click to toggle source
the name of the worker
# File lib/job_dispatch/broker/command.rb, line 39 def worker_name @parameters[:worker_name] end
worker_ready?()
click to toggle source
# File lib/job_dispatch/broker/command.rb, line 18 def worker_ready? @parameters[:command] == "ready" || @parameters[:ready] end