Class: Skynet::WorkerStatusMessage

Inherits:
Message
  • Object
show all
Defined in:
lib/skynet/skynet_message.rb

Instance Attribute Summary

Attributes inherited from Message

#payload_type, #tasktype

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Message

#[], error_message, #error_message, error_template, #error_template, #fallback_task_message, fallback_task_message, #fallback_template, fallback_template, #fields, new_task_message, next_task_template, outstanding_results_template, outstanding_tasks_template, #payload, #payload=, #raw_payload, #raw_payload=, result_message, #result_message, result_template, #task, #timeout, #to_a, #to_h, #to_hash, #to_s

Methods included from SkynetDebugger

#args_pp, #debug, #debug_header, #error, #fatal, included, #info, #log, #printlog, #stderr, #stdout, #warn

Constructor Details

#initialize(opts) ⇒ WorkerStatusMessage

Returns a new instance of WorkerStatusMessage.



332
333
334
335
# File 'lib/skynet/skynet_message.rb', line 332

def initialize(opts)
  super
  self.tasksubtype = :worker
end

Class Method Details

.all_workers_template(hostname = nil) ⇒ Object



348
349
350
351
352
353
354
355
356
# File 'lib/skynet/skynet_message.rb', line 348

def self.all_workers_template(hostname=nil)
  template = {
    :tasksubtype => :worker,
    :hostname    => hostname,
  }
  fields.collect do |field|
    template[field]
  end
end

.worker_status_template(opts) ⇒ Object



337
338
339
340
341
342
343
344
345
346
# File 'lib/skynet/skynet_message.rb', line 337

def self.worker_status_template(opts)
  template = {
    :tasksubtype => :worker,
    :hostname    => opts[:hostname],
    :process_id  => opts[:process_id]        
  }
  fields.collect do |field|
    template[field]
  end
end