.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Tirex::Queue 3pm" .TH Tirex::Queue 3pm "2021-10-07" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Tirex::Queue \- Job queue for Tirex system .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Tirex::Queue; \& \& my $q = Tirex::Queue\->new(); \& $q\->add( Tirex::Job\->new(...) ); \& \& my $job = $q\->next(); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Tirex::Queue implements a prioritized queue of Tirex::Job items. .SH "METHODS" .IX Header "METHODS" .SS "Tirex::Queue\->\fBnew()\fP" .IX Subsection "Tirex::Queue->new()" Create new Tirex queue object. Normally, this can not fail. .ie n .SS "$queue\->\fBreset()\fP" .el .SS "\f(CW$queue\fP\->\fBreset()\fP" .IX Subsection "$queue->reset()" Reset the queue. All jobs on the queue will be lost! .PP Returns queue itself, so that calls can be chained. .ie n .SS "$queue\->\fBsize()\fP" .el .SS "\f(CW$queue\fP\->\fBsize()\fP" .IX Subsection "$queue->size()" Returns the size of the queue. .PP There can be jobs on the queue that are already expired, they will still be counted in this size value. .ie n .SS "$queue\->\fBempty()\fP" .el .SS "\f(CW$queue\fP\->\fBempty()\fP" .IX Subsection "$queue->empty()" Is the queue empty? .PP Returns true if the queue is empty, false otherwise. .ie n .SS "$queue\->\fBstatus()\fP" .el .SS "\f(CW$queue\fP\->\fBstatus()\fP" .IX Subsection "$queue->status()" Return status of the queue. .ie n .SS "$queue\->add($job1, $job2, ...)" .el .SS "\f(CW$queue\fP\->add($job1, \f(CW$job2\fP, ...)" .IX Subsection "$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. .PP Returns queue itself, so that calls can be chained. .ie n .SS "$queue\->in_queue($job)" .el .SS "\f(CW$queue\fP\->in_queue($job)" .IX Subsection "$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. .ie n .SS "$queue\->\fBnext()\fP" .el .SS "\f(CW$queue\fP\->\fBnext()\fP" .IX Subsection "$queue->next()" Removes the topmost job from the queue and return it. Returns undef if the queue is empty. .ie n .SS "$queue\->\fBpeek()\fP" .el .SS "\f(CW$queue\fP\->\fBpeek()\fP" .IX Subsection "$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. .ie n .SS "$pq\->\fBreset_maxsize()\fP" .el .SS "\f(CW$pq\fP\->\fBreset_maxsize()\fP" .IX Subsection "$pq->reset_maxsize()" Reset maxsize. New maxsize will be equal to current size. .PP Returns new maxsize; .ie n .SS "$pq\->\fBremove_jobs_for_unknown_maps()\fP" .el .SS "\f(CW$pq\fP\->\fBremove_jobs_for_unknown_maps()\fP" .IX Subsection "$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. .SH "SEE ALSO" .IX Header "SEE ALSO" Tirex::PrioQueue, Tirex::Job