instance method queue_with_priority

Ruby on Rails 7.0.10

Since v5.2.8.1

Available in: v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

queue_with_priority(priority = nil, &block)

Specifies the priority of the queue to create the job with.

class PublishToFeedJob < ActiveJob::Base
  queue_with_priority 50

  def perform(post)
    post.to_feed!
  end
end

Specify either an argument or a block.

Parameters

priority opt = nil
block block
Source
# File activejob/lib/active_job/queue_priority.rb, line 22
      def queue_with_priority(priority = nil, &block)
        if block_given?
          self.priority = block
        else
          self.priority = priority
        end
      end

Defined in activejob/lib/active_job/queue_priority.rb line 22 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveJob::QueuePriority::ClassMethods

Type at least 2 characters to search.

↑↓ navigate · open · esc close