Module: Enumerable

Included in:
Twitter::Cursor
Defined in:
lib/twitter/core_ext/enumerable.rb

Instance Method Summary collapse

Instance Method Details

#threaded_mapObject



3
4
5
6
7
8
9
10
11
# File 'lib/twitter/core_ext/enumerable.rb', line 3

def threaded_map
  abort_on_exception do
    threads = []
    each do |object|
      threads << Thread.new { yield object }
    end
    threads.map(&:value)
  end
end