Sha256: a8b67e7ceef81a9b136be4580e70c92db2ed0b8d2849fcc96c50f3c8c844bf46
Contents?: true
Size: 392 Bytes
Versions: 11
Compression:
Stored size: 392 Bytes
Contents
module Enumerable def threaded_each threads = [] result = each do |object| threads << Thread.new{yield object} end threads.each(&:join) result end def threaded_map results = map{nil} threads = [] each_with_index do |object, index| threads << Thread.new{results[index] = yield object} end threads.each(&:join) results end end
Version data entries
11 entries across 11 versions & 1 rubygems