class Mosquito::Api::Queue

Overview

Represents a named queue in the system, and allows querying the state of the queue. For more about the internals of a Queue in Mosquito, see Mosquito::Queue.

Defined in:

mosquito/api/queue.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(name : String) #

Creates an instance of a named queue.


Class Method Detail

def self.all : Array(Queue) #

Returns a list of all known named queues in the system.


Instance Method Detail

def <=>(other) #

def dead_job_runs : Array(JobRun) #

Gets a list of all the job runs in the internal dead queue.


def name : String #

The name of the queue.


def pending_job_runs : Array(JobRun) #

Gets a list of all the job runs in the internal pending queue.


def scheduled_job_runs : Array(JobRun) #

Gets a list of all the job runs in the internal scheduled queue.


def size : Int64 #

The operating size of the queue, not including dead jobs.


def size_details : Hash(String, Int64) #

The size of the queue, broken out by job state.

Example:

Mosquito::Api::Queue.all.first.size_details
# => {"waiting" => 0, "scheduled" => 0, "pending" => 0, "dead" => 0}

The semantics of the keys are described in detail on the Mosquito::Queue class, but in brief:

  • scheduled is a list of jobs which are scheduled to be executed at a later time.
  • waiting is a list of jobs which should be executed ASAP
  • pending is a list of jobs for which execution has started
  • dead is a list of jobs which have failed to execute

def waiting_job_runs : Array(JobRun) #

Gets a list of all the job runs in the internal waiting queue.