Skip to content

Instantly share code, notes, and snippets.

@jonbca
Forked from joejag/peach.rb
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonbca/5d5fa680387148798881 to your computer and use it in GitHub Desktop.
Save jonbca/5d5fa680387148798881 to your computer and use it in GitHub Desktop.
class Array
def peach(&block)
threads = []
self.each do |item|
threads << Thread.new do
block.call(item)
end
end
threads.each(&:join)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment