rake.d/vendor/drake-0.9.2.0.3.1/lib/rake/multi_task.rb
raw| 1 | module Rake |
| 2 | |
| 3 | # Same as a regular task, but the immediate prerequisites are done in |
| 4 | # parallel using Ruby threads. |
| 5 | # |
| 6 | class MultiTask < Task |
| 7 | private |
| 8 | def invoke_prerequisites(args, invocation_chain) |
| 9 | threads = @prerequisites.collect { |p| |
| 10 | Thread.new(p) { |r| application[r, @scope].invoke_with_call_chain(args, invocation_chain) } |
| 11 | } |
| 12 | threads.each { |t| t.join } |
| 13 | end |
| 14 | end |
| 15 | |
| 16 | end |