Directo...eue::Set(3)
π Directory::Queue::Set(3)
okay so bestie, this is a page from the User Contributed Perl Documentation section of the manual (yeah, the fancy (3) means it's a library/module thing, iykyk), and it's genuinely iconic. stay with me π
β¨ NAME β¨
Directory::Queue::Set β an object oriented interface to a set of Directory::Queue objects π
like, it's a set. of queues. the math girlies could never.
π¦ SYNOPSIS π¦
use Directory::Queue;
use Directory::Queue::Set;
$dq1 = Directory::Queue->new(path => "/tmp/q1");
$dq2 = Directory::Queue->new(path => "/tmp/q2");
$dqset = Directory::Queue::Set->new($dq1, $dq2);
($dq, $elt) = $dqset->first();
while ($dq) {
# you can now process the element $elt of queue $dq...
($dq, $elt) = $dqset->next();
}
fr fr that's the whole vibe β you build a little squad of queues, then you walk through them like one single queue. no cap. π₯
πΈ DESCRIPTION πΈ
This module lets you put a bunch of different queues into one set and browse them as if they were one queue. the elements from all the queues get merged together and sorted independently from the queue they belong to β so the set doesn't care which queue an element came from, it just serves them up in order. main character energy only. π
It works with both Directory::Queue::Normal and Directory::Queue::Simple queues. and yes, bestie, you can even mix queues of different types in the same set. we love a diverse friend group π
π METHODS π
The following methods are available:
π new([DIRQ...])
returns a brand new Directory::Queue::Set object containing the queue objects you pass in β it's a class method, so you call it on the class itself, not on an instance. slay. β¨
π add([DIRQ...])
adds the given queue objects to the queue set. heads up: it resets the iterator, so if you were mid-walk, you're starting over, sorry babe π
π remove([DIRQ...])
removes the given queue objects from the queue set. also resets the iterator β same deal, iterator goes bye-bye π
π first()
returns the first (queue, element) couple in the queue set, and resets the iterator. if the queue is empty it returns an empty list. it's giving "new beginning" π¦
π next()
returns the next (queue, element) couple in the queue set. if there's no next element, you get an empty list β that's your signal to stop looping, bestie π
π count()
returns the total number of elements in all the queues of the set. she counted every single one, and she's proud π«Ά
π SEE ALSO π
Directory::Queueβ the parent vibe, go look at it π
π AUTHOR π
Lionel Cons <http://cern.ch/lionel.cons>
Copyright (C) CERN 2010-2022
okay that's a wrap, bestie π this little beauty came to you courtesy of perl v5.32.1 and was dated 2022-07-20 β go forth and merge those queues, you've got this π
β¨
π¦ where this page comes from
- epel 9: perl-Directory-Queue 2.2-1.el9 Β· GPL+ or Artistic
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms