Scroll to navigation

Tirex::Queue(3pm) User Contributed Perl Documentation Tirex::Queue(3pm)

NAME

Tirex::Queue - Job queue for Tirex system

SYNOPSIS

 use Tirex::Queue;
 my $q = Tirex::Queue->new();
 $q->add( Tirex::Job->new(...) );
 my $job = $q->next();

DESCRIPTION

Tirex::Queue implements a prioritized queue of Tirex::Job items.

METHODS

Tirex::Queue->new()

Create new Tirex queue object. Normally, this can not fail.

$queue->reset()

Reset the queue. All jobs on the queue will be lost!

Returns queue itself, so that calls can be chained.

$queue->size()

Returns the size of the queue.

There can be jobs on the queue that are already expired, they will still be counted in this size value.

$queue->empty()

Is the queue empty?

Returns true if the queue is empty, false otherwise.

$queue->status()

Return status of the queue.

$queue->add($job1, $job2, ...)

Adds one or more jobs to the queue. You can also call it with an array reference and all jobs inside the array will be added to the queue.

Returns queue itself, so that calls can be chained.

$queue->in_queue($job)

Is this metatile already in the queue? Returns the job that is in the queue or undef, if its not in there.

$queue->next()

Removes the topmost job from the queue and return it. Returns undef if the queue is empty.

$queue->peek()

Peek at the topmost job from the queue and return it. Does not remove the job from queue. Returns undef if the queue is empty.

$pq->reset_maxsize()

Reset maxsize. New maxsize will be equal to current size.

Returns new maxsize;

$pq->remove_jobs_for_unknown_maps()

Remove all jobs from this prioqueue where the map is undefined. This can happen after a reload of the config file, when a map was deleted from it.

SEE ALSO

Tirex::PrioQueue, Tirex::Job

2021-10-07 perl v5.32.1