2017-07-09 13:49:52 -04:00
|
|
|
# frozen_string_literal: true
|
2017-07-10 09:40:03 -04:00
|
|
|
|
2014-08-25 10:34:50 -04:00
|
|
|
module ActiveJob
|
|
|
|
class ConfiguredJob #:nodoc:
|
2016-10-28 23:05:58 -04:00
|
|
|
def initialize(job_class, options = {})
|
2014-08-25 10:34:50 -04:00
|
|
|
@options = options
|
|
|
|
@job_class = job_class
|
|
|
|
end
|
|
|
|
|
|
|
|
def perform_now(*args)
|
|
|
|
@job_class.new(*args).perform_now
|
|
|
|
end
|
2020-01-19 00:29:32 -05:00
|
|
|
ruby2_keywords(:perform_now) if respond_to?(:ruby2_keywords, true)
|
2014-08-25 10:34:50 -04:00
|
|
|
|
|
|
|
def perform_later(*args)
|
|
|
|
@job_class.new(*args).enqueue @options
|
|
|
|
end
|
2020-01-19 00:29:32 -05:00
|
|
|
ruby2_keywords(:perform_later) if respond_to?(:ruby2_keywords, true)
|
2014-08-25 10:34:50 -04:00
|
|
|
end
|
|
|
|
end
|