lib/picky/cores.rb in picky-0.3.0 vs lib/picky/cores.rb in picky-0.9.0
- old
+ new
@@ -23,12 +23,11 @@
max = max_processors options
currently_processing = 0
#
#
- while generator
-
+ loop do
# Ramp it up to num processors.
#
while currently_processing < max
currently_processing = currently_processing + 1
@@ -40,9 +39,10 @@
break
end
break unless element
Process.fork do
+ sleep 0.01*currently_processing
yield element
end
end
\ No newline at end of file