Class: ActiveJob::QueueAdapters::BackburnerAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/active_job/queue_adapters/backburner_adapter.rb

Defined Under Namespace

Classes: JobWrapper

Class Method Summary collapse

Class Method Details

.enqueue(job) ⇒ Object



7
8
9
# File 'lib/active_job/queue_adapters/backburner_adapter.rb', line 7

def enqueue(job)
  Backburner::Worker.enqueue JobWrapper, [ job.serialize ], queue: job.queue_name
end

.enqueue_at(job, timestamp) ⇒ Object



11
12
13
14
# File 'lib/active_job/queue_adapters/backburner_adapter.rb', line 11

def enqueue_at(job, timestamp)
  delay = timestamp - Time.current.to_f
  Backburner::Worker.enqueue JobWrapper, [ job.serialize ], queue: job.queue_name, delay: delay
end