2014-05-18 07:10:34 -04:00
|
|
|
module ActiveJob
|
|
|
|
module QueueAdapters
|
2014-09-21 16:20:23 -04:00
|
|
|
# == Active Job Inline adapter
|
|
|
|
#
|
|
|
|
# When enqueueing jobs with the Inline adapter the job will be executed
|
|
|
|
# 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
|