Sha256: 9707c187d0a9380ee44e01ac52e047c36e42cfc8d1ca9073b2013dd57cfa0340
Contents?: true
Size: 1.1 KB
Versions: 51
Compression:
Stored size: 1.1 KB
Contents
require 'backburner' module ActiveJob module QueueAdapters # == 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}[https://github.com/nesquena/backburner]. # # To use Backburner set the queue_adapter config to +:backburner+. # # Rails.application.config.active_job.queue_adapter = :backburner class BackburnerAdapter class << self def enqueue(job) #:nodoc: Backburner::Worker.enqueue JobWrapper, [ job.serialize ], queue: job.queue_name end def enqueue_at(job, timestamp) #:nodoc: delay = timestamp - Time.current.to_f Backburner::Worker.enqueue JobWrapper, [ job.serialize ], queue: job.queue_name, delay: delay end end class JobWrapper #:nodoc: class << self def perform(job_data) Base.execute job_data end end end end end end
Version data entries
51 entries across 50 versions & 8 rubygems