aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/lib/active_job/queue_adapters/inline_adapter.rb
blob: 08e26b7418bb1189935cf598b675fc0d35242a9f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module ActiveJob
  module QueueAdapters
    # == 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
    class InlineAdapter
      class << self
        def enqueue(job) #:nodoc:
          Base.execute(job.serialize)
        end

        def enqueue_at(*) #:nodoc:
          raise NotImplementedError.new("Use a queueing backend to enqueue jobs in the future. Read more at http://guides.rubyonrails.org/v4.2.0/active_job_basics.html")
        end
      end
    end
  end
end