Skip to content

Instantly share code, notes, and snippets.

@hanshasselberg
Created September 10, 2012 19:23
Show Gist options
  • Save hanshasselberg/3693182 to your computer and use it in GitHub Desktop.
Save hanshasselberg/3693182 to your computer and use it in GitHub Desktop.
Hydra
Typhoeus.on_complete {|r| p Time.now.to_f }
hydra = Typhoeus::Hydra.new(max_concurrency: 1)
10.times.map{ hydra.queue(Typhoeus::Request.new("www.example.com")) }
hydra.run
# 1347304950.781197
# 1347304950.9252968
# 1347304951.216028
# 1347304951.3606741
# 1347304951.660367
# 1347304951.80959
# 1347304952.101176
# 1347304952.24737
# 1347304952.541461
# 1347304952.691637
#=> {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment