2017-07-09 13:49:52 -04:00
|
|
|
# frozen_string_literal: true
|
2017-07-10 09:40:03 -04:00
|
|
|
|
2014-05-18 07:10:34 -04:00
|
|
|
module ActiveJob
|
|
|
|
module QueueAdapters
|
2014-09-21 16:20:23 -04:00
|
|
|
# == Active Job Inline adapter
|
|
|
|
#
|
2016-02-12 13:19:08 -05:00
|
|
|
# When enqueuing jobs with the Inline adapter the job will be executed
|
2014-09-21 16:20:23 -04:00
|
|
|
# immediately.
|
|
|
|
#
|
|
|
|
# To use the Inline set the queue_adapter config to +:inline+.
|
|
|
|
#
|
|
|
|
# Rails.application.config.active_job.queue_adapter = :inline
|
2014-05-18 07:10:34 -04:00
|
|
|
class InlineAdapter
|
2015-03-11 17:57:13 -04:00
|
|
|
def enqueue(job) #:nodoc:
|
|
|
|
Base.execute(job.serialize)
|
|
|
|
end
|
2014-05-19 18:27:28 -04:00
|
|
|
|
2015-03-11 17:57:13 -04:00
|
|
|
def enqueue_at(*) #:nodoc:
|
2015-04-29 05:23:10 -04:00
|
|
|
raise NotImplementedError, "Use a queueing backend to enqueue jobs in the future. Read more at http://guides.rubyonrails.org/active_job_basics.html"
|
2014-05-18 07:10:34 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2014-05-19 18:27:28 -04:00
|
|
|
end
|