Module: ActiveJob::QueueAdapter::ClassMethods

Defined in:
lib/active_job/queue_adapter.rb

Overview

Includes the setter method for changing the active queue adapter.

Instance Method Summary collapse

Instance Method Details

#queue_adapter=(name_or_adapter) ⇒ Object

Specify the backend queue provider. The default queue adapter is the :inline queue. See QueueAdapters for more information.



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/active_job/queue_adapter.rb', line 17

def queue_adapter=(name_or_adapter)
  @@queue_adapter = \
    case name_or_adapter
    when :test
      ActiveJob::QueueAdapters::TestAdapter.new
    when Symbol, String
      load_adapter(name_or_adapter)
    else
      name_or_adapter if name_or_adapter.respond_to?(:enqueue)
    end
end