Module: Ntswf::DecisionWorker
- Includes:
- Worker
- Defined in:
- lib/ntswf/decision_worker.rb
Overview
Interface for a worker arbitrating tasks, optionally for multiple apps
Constant Summary
Constants included from Worker
Instance Method Summary collapse
-
#process_decision_task ⇒ Object
Process a decision task.
-
#process_decisions ⇒ Object
Start the worker loop for decision tasks.
Methods included from Worker
Methods included from Base
#activity_task_list, #activity_task_lists, #activity_type, #configure, #decision_task_list, #default_unit, #domain, #execution_version, #notify, #on_notify, #parse_input, #separator, #swf, #workflow_name, #workflow_version
Instance Method Details
#process_decision_task ⇒ Object
Process a decision task. The following task values are interpreted:
- input
- reason
-
reschedule if Worker::RETRY
- result
-
Interpreted as Hash, see below for keys
Result keys
- :seconds_until_retry
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/ntswf/decision_worker.rb', line 20 def process_decision_task announce("polling for decision task #{decision_task_list}") domain.decision_tasks.poll_for_single_task(decision_task_list) do |task| announce("got decision task #{task.workflow_execution.inspect}") begin task.new_events.each { |event| process_decision_event(task, event) } rescue => e notify(e, workflow_execution: task.workflow_execution.inspect) raise e end end end |
#process_decisions ⇒ Object
Start the worker loop for decision tasks.
9 10 11 |
# File 'lib/ntswf/decision_worker.rb', line 9 def process_decisions loop { in_subprocess :process_decision_task } end |