Class: JFlow::Activity::Worker

Inherits:
Object
  • Object
show all
Defined in:
lib/jflow/activity/worker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(domain, tasklist) ⇒ Worker

Returns a new instance of Worker.



7
8
9
10
# File 'lib/jflow/activity/worker.rb', line 7

def initialize(domain, tasklist)
  @domain = domain
  @tasklist = tasklist
end

Instance Attribute Details

#domainObject (readonly)

Returns the value of attribute domain.



5
6
7
# File 'lib/jflow/activity/worker.rb', line 5

def domain
  @domain
end

#tasklistObject (readonly)

Returns the value of attribute tasklist.



5
6
7
# File 'lib/jflow/activity/worker.rb', line 5

def tasklist
  @tasklist
end

Instance Method Details

#start!Object



12
13
14
15
16
17
# File 'lib/jflow/activity/worker.rb', line 12

def start!
  loop do
    log "Polling for task on #{domain} - #{tasklist}"
    poll
  end
end