1Directory::Queue::Set(3U)ser Contributed Perl DocumentatiDoinrectory::Queue::Set(3)
2
3
4

NAME

6       Directory::Queue::Set - object oriented interface to a set of
7       Directory::Queue objects
8

SYNOPSIS

10         use Directory::Queue;
11         use Directory::Queue::Set;
12
13         $dq1 = Directory::Queue->new(path => "/tmp/q1");
14         $dq2 = Directory::Queue->new(path => "/tmp/q2");
15         $dqset = Directory::Queue::Set->new($dq1, $dq2);
16
17         ($dq, $elt) = $dqset->first();
18         while ($dq) {
19             # you can now process the element $elt of queue $dq...
20             ($dq, $elt) = $dqset->next();
21         }
22

DESCRIPTION

24       This module can be used to put different queues into a set and browse
25       them as one queue. The elements from all queues are merged together and
26       sorted independently from the queue they belong to.
27
28       This works both with Directory::Queue::Normal and
29       Directory::Queue::Simple queues. Queues of different types can even be
30       mixed.
31

METHODS

33       The following methods are available:
34
35       new([DIRQ...])
36           return a new Directory::Queue::Set object containing the given
37           queue objects (class method)
38
39       add([DIRQ...])
40           add the given queue objects to the queue set; resetting the
41           iterator
42
43       remove([DIRQ...])
44           remove the given queue objects from the queue set; resetting the
45           iterator
46
47       first()
48           return the first (queue, element) couple in the queue set,
49           resetting the iterator; return an empty list if the queue is empty
50
51       next()
52           return the next (queue, element) couple in the queue set; return an
53           empty list if there is no next element
54
55       count()
56           return the total number of elements in all the queues of the set
57

SEE ALSO

59       Directory::Queue.
60

AUTHOR

62       Lionel Cons <http://cern.ch/lionel.cons>
63
64       Copyright (C) CERN 2010-2018
65
66
67
68perl v5.32.0                      2020-07-28          Directory::Queue::Set(3)
Impressum