diff options
Diffstat (limited to 'activejob/lib/active_job')
-rw-r--r-- | activejob/lib/active_job/queue_adapter.rb | 6 | ||||
-rw-r--r-- | activejob/lib/active_job/queue_adapters.rb | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/activejob/lib/active_job/queue_adapter.rb b/activejob/lib/active_job/queue_adapter.rb index 9c4519432d..457015b741 100644 --- a/activejob/lib/active_job/queue_adapter.rb +++ b/activejob/lib/active_job/queue_adapter.rb @@ -4,7 +4,7 @@ require 'active_support/core_ext/string/inflections' module ActiveJob # The <tt>ActiveJob::QueueAdapter</tt> module is used to load the - # correct adapter. The default queue adapter is the :inline queue. + # correct adapter. The default queue adapter is the +:inline+ queue. module QueueAdapter #:nodoc: extend ActiveSupport::Concern @@ -15,12 +15,14 @@ module ActiveJob # Includes the setter method for changing the active queue adapter. module ClassMethods + # Returns the backend queue provider. The default queue adapter + # is the +:inline+ queue. See QueueAdapters for more information. def queue_adapter _queue_adapter end # Specify the backend queue provider. The default queue adapter - # is the :inline queue. See QueueAdapters for more + # is the +:inline+ queue. See QueueAdapters for more # information. def queue_adapter=(name_or_adapter_or_class) self._queue_adapter = interpret_adapter(name_or_adapter_or_class) diff --git a/activejob/lib/active_job/queue_adapters.rb b/activejob/lib/active_job/queue_adapters.rb index bd69e525bb..1335e3236e 100644 --- a/activejob/lib/active_job/queue_adapters.rb +++ b/activejob/lib/active_job/queue_adapters.rb @@ -116,6 +116,10 @@ module ActiveJob private_constant :ADAPTER class << self + # Returns adapter for specified name. + # + # ActiveJob::QueueAdapters.lookup(:sidekiq) + # # => ActiveJob::QueueAdapters::SidekiqAdapter def lookup(name) const_get(name.to_s.camelize << ADAPTER) end |