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.
Constant Summary
-
QUEUE_ADAPTER_METHODS =
# File 'activejob/lib/active_job/queue_adapter.rb', line 69[:enqueue, :enqueue_at].freeze
Instance Attribute Summary
-
#queue_adapter=(name_or_adapter)
writeonly
Specify the backend queue provider.
Instance Method Summary
-
#queue_adapter
writeonly
Returns the backend queue provider.
-
#queue_adapter_name
Returns string denoting the name of the configured queue adapter.
Instance Attribute Details
#queue_adapter=(name_or_adapter) (rw)
Specify the backend queue provider. The default queue adapter is the :async
queue. See QueueAdapters for more information.
# File 'activejob/lib/active_job/queue_adapter.rb', line 48
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 = ActiveJob.adapter_name(name_or_adapter).underscore assign_adapter(adapter_name, name_or_adapter) else raise ArgumentError end end end
Instance Method Details
#queue_adapter (rw)
Returns the backend queue provider. The default queue adapter is the :async
queue. See QueueAdapters for more information.
# File 'activejob/lib/active_job/queue_adapter.rb', line 35
def queue_adapter _queue_adapter end
#queue_adapter_name
Returns string denoting the name of the configured queue adapter. By default returns "async"
.
# File 'activejob/lib/active_job/queue_adapter.rb', line 41
def queue_adapter_name _queue_adapter_name end