Class: ActiveJob::QueueAdapters::AsyncAdapter::JobWrapper

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

Overview

Note that we don't actually need to serialize the jobs since we're performing them in-process, but we do so anyway for parity with other adapters and deployment environments. Otherwise, serialization bugs may creep in undetected.

Instance Method Summary collapse

Constructor Details

#initialize(job) ⇒ JobWrapper


64
65
66
67
# File 'activejob/lib/active_job/queue_adapters/async_adapter.rb', line 64

def initialize(job)
  job.provider_job_id = SecureRandom.uuid
  @job_data = job.serialize
end

Instance Method Details

#performObject


69
70
71
# File 'activejob/lib/active_job/queue_adapters/async_adapter.rb', line 69

def perform
  Base.execute @job_data
end