Class: ActiveJob::QueueAdapters::BackburnerAdapter
Relationships & Source Files | |
Namespace Children | |
Classes:
| |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
AbstractAdapter
|
|
Instance Chain:
self,
AbstractAdapter
|
|
Inherits: |
ActiveJob::QueueAdapters::AbstractAdapter
|
Defined in: | activejob/lib/active_job/queue_adapters/backburner_adapter.rb |
Overview
Backburner adapter for Active Job
Backburner is a beanstalkd-powered job queue that can handle a very high volume of jobs. You create background jobs and place them on multiple work queues to be processed later. Read more about Backburner here.
To use Backburner set the queue_adapter config to :backburner
.
Rails.application.config.active_job.queue_adapter = :backburner
Instance Method Summary
- #enqueue(job) Internal use only
- #enqueue_at(job, timestamp) Internal use only
AbstractAdapter
- Inherited
Instance Method Details
#enqueue(job)
This method is for internal use only.
[ GitHub ]
# File 'activejob/lib/active_job/queue_adapters/backburner_adapter.rb', line 18
def enqueue(job) # :nodoc: response = Backburner::Worker.enqueue(JobWrapper, [job.serialize], queue: job.queue_name, pri: job.priority) job.provider_job_id = response[:id] if response.is_a?(Hash) response end
#enqueue_at(job, timestamp)
This method is for internal use only.
[ GitHub ]
# File 'activejob/lib/active_job/queue_adapters/backburner_adapter.rb', line 24
def enqueue_at(job, ) # :nodoc: delay = - Time.current.to_f response = Backburner::Worker.enqueue(JobWrapper, [job.serialize], queue: job.queue_name, pri: job.priority, delay: delay) job.provider_job_id = response[:id] if response.is_a?(Hash) response end