module ActiveJob::QueueAdapter::ClassMethods

Includes the setter method for changing the active queue adapter.

Constants

QUEUE_ADAPTER_METHODS

Public Instance Methods

queue_adapter() Show source
# File activejob/lib/active_job/queue_adapter.rb, line 21
def queue_adapter
  _queue_adapter
end

Returns the backend queue provider. The default queue adapter is the :async queue. See QueueAdapters for more information.

queue_adapter=(name_or_adapter) Show source
# File activejob/lib/active_job/queue_adapter.rb, line 34
def queue_adapter=(name_or_adapter)
  case name_or_adapter
  when Symbol, String
    queue_adapter = ActiveJob::QueueAdapters.lookup(name_or_adapter).new
    assign_adapter(name_or_adapter.to_s, queue_adapter)
  else
    if queue_adapter?(name_or_adapter)
      adapter_name = "#{name_or_adapter.class.name.demodulize.remove('Adapter').underscore}"
      assign_adapter(adapter_name, name_or_adapter)
    else
      raise ArgumentError
    end
  end
end

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

queue_adapter_name() Show source
# File activejob/lib/active_job/queue_adapter.rb, line 27
def queue_adapter_name
  _queue_adapter_name
end

Returns string denoting the name of the configured queue adapter. By default returns +“async”+.

© 2004–2019 David Heinemeier Hansson
Licensed under the MIT License.