Messagi...ue::DQS(3)

πŸ“¦ version 1.6.1, in epel 9

✨ NAME ✨

Okay so the manual name is Messagi...ue::DQS(3) β€” yep, it’s a User Contributed Perl Documentation page, and the actual module is Messaging::Message::Queue::DQS. She’s an abstraction of a Directory::Queue::Simple message queue, and honestly that’s the whole NAME section, periodt. πŸ’…

🌸 SYNOPSIS 🌸

bestie, here’s the code vibe check:

use Messaging::Message;
use Messaging::Message::Queue::DQS;

# create a message queue
$mq = Messaging::Message::Queue::DQS->new(path => "/some/where");

# add a message to the queue
$msg = Messaging::Message->new(body => "hello world");
printf("msg added as %s\n", $mq->add_message($msg));

# browse the queue
for ($name = $mq->first(); $name; $name = $mq->next()) {
    next unless $mq->lock($name);
    $msg = $mq->get_message($name);
    # one could use $mq->unlock($name) to only browse the queue...
    $mq->remove($name);
}

πŸ¦‹ DESCRIPTION πŸ¦‹

This module is literally an abstraction of a message queue. It derives from the Directory::Queue::Simple module, which is the one giving you a generic directory based queue. It simply stores the serialized message (with optional compression) as a Directory::Queue::Simple element. That’s the lore, and it’s giving small but mighty energy. ✨

🧚 METHODS 🧚

In addition to the methods inherited from Directory::Queue::Simple, the following methods are available:

  • new(OPTIONS) β€” returns a new Messaging::Message::Queue::DQS object (class method). The OPTIONS are the ones for Directory::Queue::Simple->new() with the addition of "compression", like for Messaging::Message->jsonify(). classy.
  • add_message(MESSAGE) β€” adds the given message (a Messaging::Message object) to the queue and returns the corresponding element name. slay.
  • get_message(ELEMENT) β€” gets the message from the given element (which must be locked) and returns a Messaging::Message object.
heads up bestie: for get_message(ELEMENT), the element must be locked. no cap. πŸ”’

🌈 SEE ALSO 🌈

Go give these modules some love: Directory::Queue::Simple, Messaging::Message, Messaging::Message::Queue. iykyk. 🫢

πŸ‘‘ AUTHOR πŸ‘‘

The author is Lionel Cons <http://cern.ch/lionel.cons>.

Copyright (C) CERN 2011-2016


okay bye bestie πŸ’œ this page is from perl v5.32.1, dated 2019-07-26, and it’s the Messagi...ue::DQS(3) manual. periodt. πŸ’…

πŸ“¦ where this page comes from