Files

Enumerable

Public Instance Methods

threaded_map() click to toggle source

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
threaded_map_send(meth, *args, &block) click to toggle source

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.