Method: CloudCrowd::Worker#initialize

Defined in:
lib/cloud_crowd/worker.rb

#initialize(node, unit) ⇒ Worker

A new Worker customizes itself to its WorkUnit at instantiation.



20
21
22
23
24
25
26
27
28
# File 'lib/cloud_crowd/worker.rb', line 20

def initialize(node, unit)
  @start_time = Time.now
  @pid        = $$
  @node       = node
  @unit       = unit
  @status     = @unit['status']
  @retry_wait = RETRY_WAIT
  $0 = "#{unit['action']} (#{unit['id']}) [cloud-crowd-worker]"
end