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
|
|
|
|
class << self
|
2014-09-21 16:20:23 -04:00
|
|
|
def enqueue(job) #:nodoc:
|
2014-08-25 10:34:50 -04:00
|
|
|
Base.execute(job.serialize)
|
2014-05-18 07:10:34 -04:00
|
|
|
end
|
2014-05-19 18:27:28 -04:00
|
|
|
|
2014-09-21 16:20:23 -04:00
|
|
|
def enqueue_at(*) #:nodoc:
|
2014-06-02 18:04:08 -04:00
|
|
|
raise NotImplementedError.new("Use a queueing backend to enqueue jobs in the future. Read more at https://github.com/rails/activejob")
|
2014-05-19 18:27:28 -04:00
|
|
|
end
|
2014-05-18 07:10:34 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2014-05-19 18:27:28 -04:00
|
|
|
end
|