module ActiveJob::QueueName::ClassMethods - activejob-4.2.3 Documentation

# module ActiveJob::QueueName::ClassMethods

Includes the ability to override the default queue name and prefix.

### Public Instance Methods

queue_as(part_name=nil, &block) click to toggle source

Specifies the name of the queue to process the job on.

    class PublishToFeedJob < ActiveJob::Base
      queue_as :feeds

      def perform(post)
        post.to_feed!
      end
    end

    # File lib/active_job/queue_name.rb, line 19
    def queue_as(part_name=nil, &block)
      if block_given?
        self.queue_name = block
      else
        self.queue_name = queue_name_from_part(part_name)
      end
    end