我正在使用 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
但是,当我运行它(hydra.run)时,它似乎正在一个接一个地运行......
可能是什么问题?谢谢