class SWF::Runner

Attributes

domain_name[R]
task_list_name[R]

Public Class Methods

new(domain_name, task_list_name) click to toggle source
# File lib/swf/runner.rb, line 8
def initialize(domain_name, task_list_name)
  @domain_name    = domain_name
  @task_list_name = task_list_name
end

Public Instance Methods

be_decider() click to toggle source
# File lib/swf/runner.rb, line 13
def be_decider
  domain.decision_tasks.poll(task_list) {|decision_task|
    DecisionTaskHandler.handle(self, decision_task)
  }
end
be_worker() click to toggle source
# File lib/swf/runner.rb, line 19
def be_worker
  domain.activity_tasks.poll(task_list) {|activity_task|
    ActivityTaskHandler.handle(self, activity_task)
  }
end
domain() click to toggle source
# File lib/swf/runner.rb, line 31
def domain
  @domain ||= begin
    SWF.domain_name = domain_name
    SWF.domain
  end
end
effect_activity_type(name, version, options={}) click to toggle source
# File lib/swf/runner.rb, line 45
def effect_activity_type(name, version, options={})
  @activity_types ||= {}
  @activity_types[[name, version]] ||= domain.activity_types.find {|t| [t.name, t.version] == [name, version] }
  @activity_types[[name, version]] ||= domain.activity_types.create(name, version, options)
end
tag_lists() click to toggle source

these are static for workflow executions so no need to refetch per decision_task

# File lib/swf/runner.rb, line 27
def tag_lists
  @tag_lists ||= {}
end
task_list() click to toggle source
# File lib/swf/runner.rb, line 38
def task_list
  @task_list ||= begin
    SWF.task_list = task_list_name
  end
end