123456789_123456789_123456789_123456789_123456789_

Class: ActiveJob::ConfiguredJob

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: activejob/lib/active_job/configured_job.rb

Class Method Summary

Instance Method Summary

Constructor Details

.new(job_class, options = {}) ⇒ ConfiguredJob

[ GitHub ]

  
# File 'activejob/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)

[ GitHub ]

  
# File 'activejob/lib/active_job/configured_job.rb', line 23

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

#perform_later {|job| ... }

Yields:

  • (job)
[ GitHub ]

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

def perform_later(...)
  job = @job_class.new(...)
  enqueue_result = job.enqueue(@options)

  yield job if block_given?

  enqueue_result
end

#perform_now

[ GitHub ]

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

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