10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/concurrent_downloader/processor.rb', line 10
def process_queue!(queue, options={}, &block)
@queue = queue || []
@host = options[:host]
@error_limit = options[:error_limit] || 0
@concurrent_downloads = options[:concurrent_downloads] || 1
@connect_timeout = options[:connect_timeout] || 5
@inactivity_timeout = options[:inactivity_timeout] || 10
@error_count = 0
@error_limit_passed = false
@response_block = block
EM.run do
@concurrent_downloads.times do |downloader_id|
recursive_download(downloader_id)
end
end
end
|