0

I am using typhoeus hydra

hydra = Typhoeus::Hydra.new(max_concurrency: 10)        
links.each_with_index do |link, i| 
                req = Typhoeus::Request.new("#{link}") 
                req.on_complete do |res|
                    puts "doing #{i} out of #{links.size}"
                    threadJob(res.body, i, products)                    
                end
                hydra.queue req
            end     

However, when I run it (hydra.run) it seems as if it is running one by one...

What can be the issue? Thanks

Himberjack
  • 5,682
  • 18
  • 71
  • 115
  • 1
    It's not. It is running in parallel. I guess `puts`s are printed one by one because every request takes different time to execute. Do the benchmark and you will see that this implementation is faster then usual loop. – Kirill Aug 21 '15 at 06:34
  • You can install Charles Web Proxy and check your version – Igor Pavlov Aug 21 '15 at 07:21

0 Answers0