Class: ActiveJob::ConfiguredJob

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

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(job_class, options = {}) ⇒ ConfiguredJob

Returns a new instance of ConfiguredJob.



5
6
7
8
# File 'lib/active_job/configured_job.rb', line 5

def initialize(job_class, options = {})
  @options = options
  @job_class = job_class
end

Instance Method Details

#perform_all_later(multi_args) ⇒ Object



18
19
20
# File 'lib/active_job/configured_job.rb', line 18

def perform_all_later(multi_args)
  @job_class.perform_all_later(multi_args, options: @options)
end

#perform_laterObject



14
15
16
# File 'lib/active_job/configured_job.rb', line 14

def perform_later(...)
  @job_class.new(...).enqueue @options
end

#perform_nowObject



10
11
12
# File 'lib/active_job/configured_job.rb', line 10

def perform_now(...)
  @job_class.new(...).set(@options).perform_now
end