Class: ActiveJob::QueueAdapters::BelatedAdapter

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

Overview

The adapter in charge of handling ActiveJob integration. WIP

Defined Under Namespace

Classes: JobWrapper

Instance Method Summary collapse

Instance Method Details

#enqueue(job) ⇒ Object

:nodoc:



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

def enqueue(job) # :nodoc:
  Rails.logger.info "Belated got job #{job}"
  instance.perform(job, active_job: true)
end

#enqueue_at(job, timestamp) ⇒ Object

:nodoc:



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

def enqueue_at(job, timestamp) # :nodoc:
  Rails.logger.info "Belated got job #{job} to be performed at #{Time.at(timestamp)}"
  instance.perform_belated(job, at: timestamp, active_job: true)
end

#instanceObject



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

def instance
  @instance ||= Belated::Client.instance
rescue StandardError
  @instance = Belated::Client.new
end