class ByeFlickr::PhotoDownloader::Worker

Public Class Methods

new(downloader) click to toggle source
# File lib/bye_flickr/photo_downloader.rb, line 83
def initialize(downloader)
  @downloader = downloader
end

Public Instance Methods

run() click to toggle source
# File lib/bye_flickr/photo_downloader.rb, line 87
def run
  while file = @downloader.next or @downloader.running? do
    if file
      @downloader.download(file)
      print '.'
    else
      # queue is empty but we're still running, wait a bit and try again
      sleep 1
    end
  end
end