Tirex::Queue(3pm)

πŸ’– NAME πŸ’–

Tirex::Queue β€” the job queue for the Tirex system, bestie. It's giving "line up, we'll get to you when we get to you" ✨


πŸŽ€ SYNOPSIS πŸŽ€

use Tirex::Queue;

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

my $job = $q->next();

like. that's the whole vibe. four lines and you're queuing 🌸


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so Tirex::Queue implements a prioritized queue of Tirex::Job items. not just any queue β€” a prioritized one. the jobs have main character energy and the important ones go first πŸ’…πŸ‘‘


πŸ‘‘ METHODS πŸ‘‘

πŸ’œ Tirex::Queue->new()

Makes you a shiny new Tirex queue object. Normally this can not fail. so like, no anxiety, it's gonna work, we love low-stakes constructor behavior 🫢


🧚 $queue->reset()

Resets the queue. All jobs on the queue will be lost! 😭 like, gone gone. no takebacks.

Returns the queue itself, so you can chain calls. obsessed with a method that hands you back yourself, honestly iconic ✨


🌸 $queue->size()

Returns the size of the queue. πŸ“

Heads up though: there can be jobs on the queue that are already expired, and they will still be counted in this size value. so the number is the number, expired girlies included πŸ™ˆ


πŸŽ€ $queue->empty()

Is the queue empty? the eternal question.

Returns true if the queue is empty, false otherwise. boolean realness πŸ¦‹


⭐ $queue->status()

Return status of the queue. that's it. that's the post πŸ’«


πŸ”₯ $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. versatile queen πŸ‘‘

Returns the queue itself, so that calls can be chained. periodt.


🌈 $queue->in_queue($job)

Is this metatile already in the queue? asking the important questions πŸ™‹β€β™€οΈ

Returns the job that is in the queue, or undef if it's not in there. no job, no answer, just undef β€” the void, the silence πŸ’€


πŸ“ $queue->next()

Removes the topmost job from the queue and returns it. bye bestie, you're up πŸ’…

Returns undef if the queue is empty. nothing to serve, nobody home 😭


πŸ¦‹ $queue->peek()

Peek at the topmost job from the queue and return it. πŸ‘€

Does not remove the job from queue. it's a look, not a grab. respectful. we love a no-strings peek ✨

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. so like, ghost jobs for maps that no longer exist β€” sweep them out, cleanse the timeline 🌸


πŸ’– SEE ALSO πŸ’–

  • Tirex::PrioQueue
  • Tirex::Job

and that's the whole page, bestie!! this was documented for perl v5.40.1, dated 2026-08-09 β€” shoutout to the User Contributed Perl Documentation crew for hosting the whole thing 🫢✨ go queue something, you got this πŸ’…

πŸ“¦ where this page comes from