lib/backgrounder/support/backends.rb in carrierwave_backgrounder-0.4.3 vs lib/backgrounder/support/backends.rb in carrierwave_backgrounder-1.0.0.beta
- old
+ new
@@ -24,60 +24,16 @@
def enqueue_active_job(worker, *args)
worker.perform_later(*args.map(&:to_s))
end
- def enqueue_delayed_job(worker, *args)
- worker_args = {}
- if ::Delayed::Job.new.respond_to?(:queue)
- worker_args[:queue] = queue_options[:queue] if queue_options[:queue]
- worker_args[:priority] = queue_options[:priority] if queue_options[:priority]
- ::Delayed::Job.enqueue worker.new(*args), worker_args
- else
- worker_args[:priority] = queue_options[:priority] if queue_options[:priority]
- ::Delayed::Job.enqueue worker.new(*args), worker_args
- if queue_options[:queue]
- ::Rails.logger.warn("Queue name given but no queue column exists for Delayed::Job")
- end
- end
- end
-
- def enqueue_resque(worker, *args)
- worker.instance_variable_set('@queue', queue_options[:queue] || :carrierwave)
- ::Resque.enqueue worker, *args
- end
-
def enqueue_sidekiq(worker, *args)
override_queue_name = worker.sidekiq_options['queue'] == 'default' || worker.sidekiq_options['queue'].nil?
args = sidekiq_queue_options(override_queue_name, 'class' => worker, 'args' => args.map(&:to_s))
worker.client_push(args)
end
- def enqueue_girl_friday(worker, *args)
- @girl_friday_queue ||= GirlFriday::WorkQueue.new(queue_options.delete(:queue) || :carrierwave, queue_options) do |msg|
- worker = msg[:worker]
- worker.perform
- end
- @girl_friday_queue << { :worker => worker.new(*args) }
- end
-
- def enqueue_sucker_punch(worker, *args)
- worker.new.async.perform(*args)
- end
-
- def enqueue_qu(worker, *args)
- worker.instance_variable_set('@queue', queue_options[:queue] || :carrierwave)
- ::Qu.enqueue worker, *args
- end
-
- def enqueue_qc(worker, *args)
- class_name, subject_id, mounted_as = args
- ::QC.enqueue "#{worker.name}.perform", class_name, subject_id, mounted_as.to_s
- end
-
- def enqueue_immediate(worker, *args)
- worker.new(*args).perform
- end
+ private
def sidekiq_queue_options(override_queue_name, args)
if override_queue_name && queue_options[:queue]
args['queue'] = queue_options[:queue]
end