1Messaging::Message::QueUusee:r:DCQoNn(t3r)ibuted Perl DoMceusmseangtiantgi:o:nMessage::Queue::DQN(3)
2
3
4

NAME

6       Messaging::Message::Queue::DQN - abstraction of a
7       Directory::Queue::Normal message queue
8

SYNOPSIS

10         use Messaging::Message;
11         use Messaging::Message::Queue::DQN;
12
13         # create a message queue
14         $mq = Messaging::Message::Queue::DQN->new(path => "/some/where");
15
16         # add a message to the queue
17         $msg = Messaging::Message->new(body => "hello world");
18         printf("msg added as %s\n", $mq->add_message($msg));
19
20         # browse the queue
21         for ($name = $mq->first(); $name; $name = $mq->next()) {
22             next unless $mq->lock($name);
23             $msg = $mq->get_message($name);
24             # one could use $mq->unlock($name) to only browse the queue...
25             $mq->remove($name);
26         }
27

DESCRIPTION

29       This module provides an abstraction of a message queue. It derives from
30       the Directory::Queue::Normal module that provides a generic directory
31       based queue.
32
33       It uses the following Directory::Queue::Normal schema to store a
34       message:
35
36         $schema = {
37             header => "table",
38             binary => "binary?",
39             text   => "string?",
40         };
41
42       The message header is therefore stored as a table and the message body
43       is stored either as a text or binary string.
44

METHODS

46       In addition to the methods inherited from Directory::Queue::Normal, the
47       following methods are available:
48
49       new(OPTIONS)
50           return a new Messaging::Message::Queue::DQN object (class method),
51           the OPTIONS are the ones for Directory::Queue::Normal->new()
52
53       add_message(MESSAGE)
54           add the given message (a Messaging::Message object) to the queue
55           and return the corresponding element name
56
57       get_message(ELEMENT)
58           get the message from the given element (which must be locked) and
59           return a Messaging::Message object
60

SEE ALSO

62       Directory::Queue::Normal, Messaging::Message,
63       Messaging::Message::Queue.
64

AUTHOR

66       Lionel Cons <http://cern.ch/lionel.cons>
67
68       Copyright (C) CERN 2011-2021
69
70
71
72perl v5.36.0                      2023-01-20 Messaging::Message::Queue::DQN(3)
Impressum