class ActiveJob::QueueAdapters::QueueClassicAdapter
Rails.application.config.active_job.queue_adapter = :queue_classic
To use Queue Classic set the queue_adapter config to :queue_classic.
Read more about Queue Classic here.
beanstalkd, 0mq) is undesirable.
production environment and that adding another dependency (e.g. redis,
queue_classic assumes that you are already using PostgreSQL in your
database load while providing a simple, intuitive developer experience.
queue. queue_classic specializes in concurrent locking and minimizing
queue_classic provides a simple interface to a PostgreSQL-backed message
== Queue Classic adapter for Active Job
def build_queue(queue_name)
ActiveJob::QueueAdapters::QueueClassicAdapter and override the
If you have a custom QC::Queue subclass you'll need to suclass
Builds a QC::Queue object to schedule jobs on.
def build_queue(queue_name) QC::Queue.new(queue_name) end
def enqueue(job) #:nodoc:
def enqueue(job) #:nodoc: build_queue(job.queue_name).enqueue("#{JobWrapper.name}.perform", job.serialize) end
def enqueue_at(job, timestamp) #:nodoc:
def enqueue_at(job, timestamp) #:nodoc: queue = build_queue(job.queue_name) unless queue.respond_to?(:enqueue_at) raise NotImplementedError, 'To be able to schedule jobs with Queue Classic ' \ 'the QC::Queue needs to respond to `enqueue_at(timestamp, method, *args)`. ' 'You can implement this yourself or you can use the queue_classic-later gem.' end queue.enqueue_at(timestamp, "#{JobWrapper.name}.perform", job.serialize) end