class ActiveJob::QueueAdapters::QueAdapter
Rails.application.config.active_job.queue_adapter = :que
To use Que set the queue_adapter config to :que
.
Read more about Que here.
Ruby and PostgreSQL that manages jobs using advisory locks.
the same ACID guarantees as the rest of your data. Que is a queue for
improves the reliability of your application by protecting your jobs with
Que is a high-performance alternative to DelayedJob or QueueClassic that
== Que adapter for Active Job
def enqueue(job) # :nodoc:
def enqueue(job) # :nodoc: job_options = { priority: job.priority, queue: job.queue_name } que_job = nil if require_job_options_kwarg? que_job = JobWrapper.enqueue job.serialize, job_options: job_options else que_job = JobWrapper.enqueue job.serialize, **job_options end job.provider_job_id = que_job.attrs["job_id"] que_job end
def enqueue_at(job, timestamp) # :nodoc:
def enqueue_at(job, timestamp) # :nodoc: job_options = { priority: job.priority, queue: job.queue_name, run_at: Time.at(timestamp) } que_job = nil if require_job_options_kwarg? que_job = JobWrapper.enqueue job.serialize, job_options: job_options else que_job = JobWrapper.enqueue job.serialize, **job_options end job.provider_job_id = que_job.attrs["job_id"] que_job end
def require_job_options_kwarg?
def require_job_options_kwarg? @require_job_options_kwarg ||= JobWrapper.method(:enqueue).parameters.any? { |ptype, pname| ptype == :key && pname == :job_options } end