Class: ActiveJob::QueueAdapters::LitejobAdapter

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

Overview

Litestack adapter for Active Job

Rails.application.config.active_job.queue_adapter = :litejob

Defined Under Namespace

Classes: Job

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ LitejobAdapter

Returns a new instance of LitejobAdapter.



15
16
17
18
19
# File 'lib/active_job/queue_adapters/litejob_adapter.rb', line 15

def initialize(options = {})
  # we currently don't honour individual options per job class
  # possible in the future?
  # Job.options = DEFAULT_OPTIONS.merge(options)
end

Instance Method Details

#enqueue(job) ⇒ Object

:nodoc:



21
22
23
24
# File 'lib/active_job/queue_adapters/litejob_adapter.rb', line 21

def enqueue(job) # :nodoc:
  Job.queue = job.queue_name
  Job.perform_async(job.serialize)
end

#enqueue_at(job, timestamp) ⇒ Object

:nodoc:



26
27
28
29
# File 'lib/active_job/queue_adapters/litejob_adapter.rb', line 26

def enqueue_at(job, timestamp) # :nodoc:
  Job.queue = job.queue_name
  Job.perform_at(timestamp, job.serialize)
end