class Dynamiq::Fetcher
Public Class Methods
bulk_requeue(inprogress, options)
click to toggle source
# File lib/dynamiq/fetcher.rb, line 15 def self.bulk_requeue(inprogress, options) return if inprogress.empty? inprogress.each(&:requeue) Sidekiq.logger.debug { "Re-queueing terminated jobs" } Sidekiq.logger.debug { "J/K NOT REALLY" } end
new(options)
click to toggle source
# File lib/dynamiq/fetcher.rb, line 3 def initialize(options) @strictly_ordered_queues = !!options[:strict] end
Public Instance Methods
queues()
click to toggle source
# File lib/dynamiq/fetcher.rb, line 11 def queues @strictly_ordered_queues ? Queue.all : Queue.all.shuffle.uniq end
retrieve_work()
click to toggle source
# File lib/dynamiq/fetcher.rb, line 7 def retrieve_work queues.each { |queue| job = queue.pop and return job } end