aboutsummaryrefslogblamecommitdiffstats
path: root/activejob/lib/active_job/queue_adapters/inline_adapter.rb
blob: 0496f8449ede917ad3c51c9ad5bc09acb60511b5 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                      

                                  
                                                                          




                                                                   
                       


                                   
 
                                
                                                                                                                                                            


         
   
module ActiveJob
  module QueueAdapters
    # == Active Job Inline adapter
    #
    # When enqueuing 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
      def enqueue(job) #:nodoc:
        Base.execute(job.serialize)
      end

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