Class: ActiveJob::ConfiguredJob
- Defined in:
- activejob/lib/active_job/configured_job.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(job_class, options = {}) ⇒ ConfiguredJob
constructor
A new instance of ConfiguredJob.
- #perform_all_later(multi_args) ⇒ Object
- #perform_later {|job| ... } ⇒ Object
- #perform_now ⇒ Object
Constructor Details
#initialize(job_class, options = {}) ⇒ ConfiguredJob
Returns a new instance of ConfiguredJob.
5 6 7 8 |
# File 'activejob/lib/active_job/configured_job.rb', line 5 def initialize(job_class, = {}) @options = @job_class = job_class end |
Instance Method Details
#perform_all_later(multi_args) ⇒ Object
23 24 25 |
# 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| ... } ⇒ Object
14 15 16 17 18 19 20 21 |
# 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 ⇒ Object
10 11 12 |
# File 'activejob/lib/active_job/configured_job.rb', line 10 def perform_now(...) @job_class.new(...).set(@options).perform_now end |