class Sidekiq::Queue

Overview

Encapsulates a queue within Sidekiq. Allows enumeration of all jobs within the queue and deletion of jobs.

queue = Sidekiq::Queue.new("mailer") queue.each do |job| job.klass # => "MyWorker" job.args # => [1, 2, 3] job.delete if job.jid == "abcdef1234567890" end

Included Modules

Defined in:

sidekiq/api.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(name : String = "default") #

[View source]

Class Method Detail

def self.all #

Return all known queues within Redis.


[View source]

Instance Method Detail

def clear #

[View source]
def each(&) #
Description copied from module Enumerable(Sidekiq::JobProxy)

Must yield this collection's elements to the block.


[View source]
def find_job(jid) #

Find the job with the given JID within this queue.

This is a slow, inefficient operation. Do not use under normal conditions. Sidekiq Pro contains a faster version.


[View source]
def latency #

Calculates this queue's latency, the difference in seconds since the oldest job in the queue was enqueued.

@return Float64


[View source]
def name : String #

[View source]
def paused? #

Sidekiq Pro overrides this


[View source]
def size #
Description copied from module Enumerable(Sidekiq::JobProxy)

Returns the number of elements in the collection.

[1, 2, 3, 4].size # => 4

[View source]