I am wondering how i can go about opening multiple concurrent connections using open-uri? i THINK I need to use threading or fibers some how but i\'m not sure.
Exampl
module MultithreadedEach
def multithreaded_each
each_with_object([]) do |item, threads|
threads << Thread.new { yield item }
end.each { |thread| thread.join }
self
end
end
Usage:
arr = [1,2,3]
arr.extend(MultithreadedEach)
arr.multithreaded_each do |n|
puts n # Each block runs in it's own thread
end