Class: ActiveJob::QueueAdapters::ResqueAdapter
- Inherits:
-
Object
- Object
- ActiveJob::QueueAdapters::ResqueAdapter
- Defined in:
- lib/active_job/queue_adapters/resque_adapter.rb
Overview
Resque adapter for Active Job
Resque (pronounced like “rescue”) is a Redis-backed library for creating background jobs, placing those jobs on multiple queues, and processing them later.
Read more about Resque here.
To use Resque set the queue_adapter config to :resque
.
Rails.application.config.active_job.queue_adapter = :resque
Defined Under Namespace
Classes: JobWrapper
Class Method Summary collapse
-
.enqueue(job) ⇒ Object
:nodoc:.
-
.enqueue_at(job, timestamp) ⇒ Object
:nodoc:.
Class Method Details
.enqueue(job) ⇒ Object
:nodoc:
30 31 32 |
# File 'lib/active_job/queue_adapters/resque_adapter.rb', line 30 def enqueue(job) #:nodoc: Resque.enqueue_to job.queue_name, JobWrapper, job.serialize end |
.enqueue_at(job, timestamp) ⇒ Object
:nodoc:
34 35 36 37 38 39 40 |
# File 'lib/active_job/queue_adapters/resque_adapter.rb', line 34 def enqueue_at(job, ) #:nodoc: unless Resque.respond_to?(:enqueue_at_with_queue) raise NotImplementedError, "To be able to schedule jobs with Resque you need the " \ "resque-scheduler gem. Please add it to your Gemfile and run bundle install" end Resque.enqueue_at_with_queue job.queue_name, , JobWrapper, job.serialize end |