Sha256: bbbe51524331ee431040b3842eb6283321181c6040f6cb6ad008eafde6ade778

Contents?: true

Size: 342 Bytes

Versions: 1

Compression:

Stored size: 342 Bytes

Contents

module Enumerable

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

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
twitter-4.1.2 lib/twitter/core_ext/enumerable.rb