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

METHODS

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

AUTHOR

55       Lionel Cons <http://cern.ch/lionel.cons>
56
57       Copyright CERN 2010
58
59
60
61perl v5.12.3                      2010-06-17          Directory::Queue::Set(3)
Impressum