Methods

Class/Module Index [+]

Quicksearch

Twitter::Utils

Public Instance Methods

parallel_map(enumerable) click to toggle source
# File lib/twitter/utils.rb, line 4
def parallel_map(enumerable)
  # Don't bother spawning a new thread if there's only one item
  if enumerable.count == 1
    enumerable.map { |object| yield object }
  else
    enumerable.map { |object| Thread.new { yield object } }.map(&:value)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.