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
-
#queue_adapter ⇒ Object
Returns the backend queue provider.
-
#queue_adapter=(name_or_adapter) ⇒ Object
Specify the backend queue provider.
-
#queue_adapter_name ⇒ Object
Returns string denoting the name of the configured queue adapter.
Instance Method Details
#queue_adapter ⇒ Object
Returns the backend queue provider. The default queue adapter is :async
. See QueueAdapters for more information.
34 35 36 37 |
# File 'lib/active_job/queue_adapter.rb', line 34 def queue_adapter self.queue_adapter = :async if _queue_adapter.nil? _queue_adapter end |
#queue_adapter=(name_or_adapter) ⇒ Object
Specify the backend queue provider. The default queue adapter is the :async
queue. See QueueAdapters for more information.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/active_job/queue_adapter.rb', line 49 def queue_adapter=(name_or_adapter) case name_or_adapter when Symbol, String queue_adapter = ActiveJob::QueueAdapters.lookup(name_or_adapter).new queue_adapter.try(:check_adapter) 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 |
#queue_adapter_name ⇒ Object
Returns string denoting the name of the configured queue adapter. By default returns "async"
.
41 42 43 44 |
# File 'lib/active_job/queue_adapter.rb', line 41 def queue_adapter_name self.queue_adapter = :async if _queue_adapter_name.nil? _queue_adapter_name end |