Like Enumerable#map but each iteration is processed via a separate thread.
CREDIT: Sean O'Halpin
# File lib/facets/standard/facets/thread.rb, line 59 def threaded_map #:yield: map{ |e| Thread.new(e){ |t| yield(t) } }.map{ |t| t.value } end
Like Enumerable#map_send but each iteration is processed via a separate thread.
CREDIT: Sean O'Halpin
# File lib/facets/standard/facets/thread.rb, line 68 def threaded_map_send(meth, *args, &block) map{ |e| Thread.new(e){ |t| t.send(meth, *args, &block) } }.map{ |t| t.value } end
Generated with the Darkfish Rdoc Generator 2.