Sha256: d186af4f35bc29a1a57f0129594153dc98dd4cf32abe80262cede75c7074392f

Contents?: true

Size: 232 Bytes

Versions: 3

Compression:

Stored size: 232 Bytes

Contents

module Enumerable

  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

3 entries across 3 versions & 1 rubygems

Version Path
t-0.3.1 lib/t/core_ext/enumerable.rb
t-0.3.0 lib/t/core_ext/enumerable.rb
t-0.2.1 lib/t/core_ext/enumerable.rb