Skip to content

Instantly share code, notes, and snippets.

@nanodeath
Created January 16, 2010 03:18
Show Gist options
  • Save nanodeath/278625 to your computer and use it in GitHub Desktop.
Save nanodeath/278625 to your computer and use it in GitHub Desktop.
>> hydra = Typhoeus::Hydra.new
=> #<Typhoeus::Hydra:0x2b2b902130e0 @multi=#<Typhoeus::Multi:0x2b2b90213068>, @retrieved_from_cache={}, @max_concurrency=200, @memoize_requests=true, @memoized_requests={}, @running_requests=0, @stubs=[], @easy_pool=[#<Typhoeus::Easy:0x2b2b90212fc8>, #<Typhoeus::Easy:0x2b2b90212f50>, #<Typhoeus::Easy:0x2b2b90212eb0>, #<Typhoeus::Easy:0x2b2b90212e10>, #<Typhoeus::Easy:0x2b2b90212d70>, #<Typhoeus::Easy:0x2b2b90212cd0>, #<Typhoeus::Easy:0x2b2b90212c30>, #<Typhoeus::Easy:0x2b2b90212b90>, #<Typhoeus::Easy:0x2b2b90212af0>, #<Typhoeus::Easy:0x2b2b90212a50>], @queued_requests=[]>
>> a = Typhoeus::Request.new("https://mail.google.com"); hydra.queue(a); hydra.run; a.response.code
=> 200
>> a = Typhoeus::Request.new("https://mail.google.com"); hydra.queue(a); hydra.run; a.response.code
=> 0
>> (hydra.send :instance_variable_set, :@easy_pool, [].fill(Typhoeus::Easy.new, 0, 5))
=> [#<Typhoeus::Easy:0x2b2b90206d40>, #<Typhoeus::Easy:0x2b2b90206d40>, #<Typhoeus::Easy:0x2b2b90206d40>, #<Typhoeus::Easy:0x2b2b90206d40>, #<Typhoeus::Easy:0x2b2b90206d40>]
>> a = Typhoeus::Request.new("https://mail.google.com"); hydra.queue(a); hydra.run; a.response.code
=> 200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment