aboutsummaryrefslogblamecommitdiffstats
path: root/activejob/lib/active_job/queue_name.rb
blob: c2186d9fe9991c4bb0553a586dcdb8e0c60ae319 (plain) (tree)
1
2
3
4
5
6
7
8
9

                  
                                 
 
                       
                                                       

                             
                                                                       




                                 
                                          

       
   
module ActiveJob
  module QueueName
    extend ActiveSupport::Concern

    module ClassMethods
      mattr_accessor(:default_queue_name) { "default" }

      def queue_as(part_name)
        self.queue_name = part_name.to_s.presence || default_queue_name
      end
    end

    included do
      class_attribute :queue_name
      self.queue_name = default_queue_name
    end
  end
end