Module: HireFire::Macro::Deprecated::QC

Included in:
QC
Defined in:
lib/hirefire/macro/deprecated/queue_classic.rb

Overview

Provides backward compatibility with the deprecated QC macro. For new implementations, refer to QC.

Instance Method Summary collapse

Instance Method Details

#queue(queue = "default") ⇒ Integer

Retrieves the total number of jobs in the specified queue using QueueClassic.

This method queries the PostgreSQL database through QueueClassic. It’s capable of counting jobs in a specific queue, defaulting to the “default” queue if none is specified. It utilizes the QC::Queue class to interface with the QueueClassic system.

Examples:

Counting jobs in the “default” queue

HireFire::Macro::QC.queue

Counting jobs in the “critical” queue

HireFire::Macro::QC.queue("critical")

Parameters:

  • queue (String, Symbol) (defaults to: "default")

    The name of the queue to count. Defaults to “default” if no queue name is provided.

Returns:

  • (Integer)

    Total number of jobs in the specified queue.



22
23
24
# File 'lib/hirefire/macro/deprecated/queue_classic.rb', line 22

def queue(queue = "default")
  ::QC::Queue.new(queue.to_s).count
end