Method: StaticImageDownloader::Downloader#parallel_download
- Defined in:
- lib/static_image_download.rb
#parallel_download(download_option = 'CURB_EASY', download_timeout = 120, allow_dup_files = true) ⇒ Object
66 67 68 69 70 71 72 73 |
# File 'lib/static_image_download.rb', line 66 def parallel_download(download_option='CURB_EASY', download_timeout=120, allow_dup_files=true) threads = [] self.images.each do |img| threads << Thread.new(img) { |image| image.download(download_option, download_timeout, :dup_file_names => allow_dup_files) } end threads.each { |aThread| aThread.join } p "Total " + Images::get_successfull_pictures_number + " pictures were got" end |