Class: Qyu::Workers::Sync
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Methods included from Concerns::FailureQueue
Methods included from Concerns::PayloadValidator
#validate_payload!, #validates
Methods included from Concerns::Callback
Constructor Details
This class inherits a constructor from Qyu::Workers::Base
Instance Method Details
#work(queue_name) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/qyu/workers/sync.rb', line 6 def work(queue_name) super do |task| job = task.job task_names_to_wait_for = job.tasks_to_wait_for(task) log(:debug, "Task names to wait for: #{task_names_to_wait_for}") task_names_to_wait_for.each do |task_name| sync_condition = job.sync_condition(task, task_name) log(:debug, "Task: #{task_name}, Sync condition: #{sync_condition}") if respond_to?(sync_condition['function'], true) __send__(sync_condition['function'], job, task, task_name, sync_condition['param']) else fail Qyu::Errors::NotImplementedError end end end end |