Module: Typhoeus::Hydra::Runnable
- Included in:
- Typhoeus::Hydra
- Defined in:
- lib/typhoeus/hydra/runnable.rb
Overview
This module contains logic to run a hydra.
Instance Method Summary collapse
-
#run ⇒ Symbol
Start the hydra run.
Instance Method Details
#run ⇒ Symbol
Start the hydra run.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/typhoeus/hydra/runnable.rb', line 13 def run number_requests = 0 loop do break if number_requests == max_concurrency || queued_requests.empty? number_requests += queued_requests.pop(max_concurrency).map do |request| add(request) end.size end multi.perform end |