diff options
Diffstat (limited to 'activejob/lib/active_job/queue_adapters/qu_adapter.rb')
-rw-r--r-- | activejob/lib/active_job/queue_adapters/qu_adapter.rb | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/activejob/lib/active_job/queue_adapters/qu_adapter.rb b/activejob/lib/active_job/queue_adapters/qu_adapter.rb index 5485f20689..7cdefefc02 100644 --- a/activejob/lib/active_job/queue_adapters/qu_adapter.rb +++ b/activejob/lib/active_job/queue_adapters/qu_adapter.rb @@ -2,15 +2,28 @@ require 'qu' module ActiveJob module QueueAdapters + # == Qu adapter for Active Job + # + # Qu is a Ruby library for queuing and processing background jobs. It is + # heavily inspired by delayed_job and Resque. Qu was created to overcome + # some shortcomings in the existing queuing libraries that we experienced. + # The advantages of Qu are: Multiple backends (redis, mongo), jobs are + # requeued when worker is killed, resque-like API. + # + # Read more about Que {here}[https://github.com/bkeepers/qu]. + # + # To use Qu set the queue_adapter config to +:qu+. + # + # Rails.application.config.active_job.queue_adapter = :qu class QuAdapter class << self - def enqueue(job, *args) + def enqueue(job, *args) #:nodoc: Qu::Payload.new(klass: JobWrapper, args: [job.serialize]).tap do |payload| payload.instance_variable_set(:@queue, job.queue_name) end.push end - def enqueue_at(job, timestamp, *args) + def enqueue_at(job, timestamp, *args) #:nodoc: raise NotImplementedError end end |