Sha256: e60ca13e0714cfb1a0dcfcac2df23b573aa407a3182e90b89e180d457b7bde95

Contents?: true

Size: 303 Bytes

Versions: 12

Compression:

Stored size: 303 Bytes

Contents

module Enumerable

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

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

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
t-0.9.9 lib/t/core_ext/enumerable.rb
t-0.9.8 lib/t/core_ext/enumerable.rb
t-0.9.7 lib/t/core_ext/enumerable.rb
t-0.9.6 lib/t/core_ext/enumerable.rb
t-0.9.5 lib/t/core_ext/enumerable.rb
t-0.9.4 lib/t/core_ext/enumerable.rb
t-0.9.3 lib/t/core_ext/enumerable.rb
t-0.9.2 lib/t/core_ext/enumerable.rb
t-0.9.1 lib/t/core_ext/enumerable.rb
t-0.9.0 lib/t/core_ext/enumerable.rb
t-0.8.3 lib/t/core_ext/enumerable.rb
t-0.8.2 lib/t/core_ext/enumerable.rb