If you can look outside EventMachine, Typhoeus is an easy-to-use HTTP client that comes with Hydra, which makes it possible to process multiple requests in parallel.
I used it for several things, and it is easy to set up. This is unverified code torn from what I wrote the other day:
require 'typhoeus' hydra = Typhoeus::Hydra.new(:max_concurrency => 10) urls.each do |url| request = Typhoeus::Request.new(url) request.on_complete do |resp| filename = resp.request.url.split('/').last puts "writing #{filename}" File.open(filename, 'w') do |fo| fo.write resp.body end end puts "queuing #{ url }" hydra.queue(request) end hydra.run
the tin man
source share