summaryrefslogtreecommitdiff
path: root/lib/rake/multi_task.rb
blob: 21c8de732f0ed77e7393e474317852059dfbb157 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module Rake

  # Same as a regular task, but the immediate prerequisites are done in
  # parallel using Ruby threads.
  #
  class MultiTask < Task
    private
    def invoke_prerequisites(args, invocation_chain)
      threads = @prerequisites.collect { |p|
        Thread.new(p) { |r| application[r, @scope].invoke_with_call_chain(args, invocation_chain) }
      }
      threads.each { |t| t.join }
    end
  end

end