Class: DRbQS::TaskSet

Inherits:
Task
  • Object
show all
Defined in:
lib/drbqs/task.rb

Instance Attribute Summary

Attributes inherited from Task

#hook

Instance Method Summary collapse

Methods inherited from Task

#drb_args, execute_task, #same_target?

Constructor Details

#initialize(task_ary) ⇒ TaskSet

Returns a new instance of TaskSet.



108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/drbqs/task.rb', line 108

def initialize(task_ary)
  @original_hook = task_ary.map do |task|
    task.hook
  end
  super(DRbQS::TaskContainer.new(task_ary), :exec) do |srv, result|
    result.each_with_index do |res, i|
      if hook = @original_hook[i]
        hook.call(srv, res)
      end
    end
  end
end