123456789_123456789_123456789_123456789_123456789_

Module: ActiveJob::QueueAdapter::ClassMethods

Relationships & Source Files
Defined in: activejob/lib/active_job/queue_adapter.rb

Overview

Includes the setter method for changing the active queue adapter.

Class Attribute Summary

Instance Attribute Summary

Class Attribute Details

.queue_adapter (readonly) Also known as: #queue_adapter

[ GitHub ]

  
# File 'activejob/lib/active_job/queue_adapter.rb', line 12

mattr_reader(:queue_adapter) { ActiveJob::QueueAdapters::InlineAdapter }

Instance Attribute Details

#queue_adapter (rw)

[ GitHub ]

  
# File 'activejob/lib/active_job/queue_adapter.rb', line 12

mattr_reader(:queue_adapter) { ActiveJob::QueueAdapters::InlineAdapter }

#queue_adapter=(name_or_adapter) (rw)

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

[ GitHub ]

  
# File 'activejob/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