Messag...ZeroMQ(3pm)

πŸ“¦
version 0.010 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– Message::Passing::Output::ZeroMQ β€” the vibe ✨

okay bestie, so this is a page from the User Contributed Perl Documentation β€” it's the manual for Message::Passing::Output::ZeroMQ, and it's literally the class that lets you yeet your messages out into ZeroMQ. let's get into it 🫢


🌸 NAME 🌸

Message::Passing::Output::ZeroMQ β€” output messages to ZeroMQ. that's it, that's the whole job πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole look, copy it exactly bestie:

use Message::Passing::Output::ZeroMQ;

my $logger = Message::Passing::Output::ZeroMQ->new;
$logger->consume({data => { some => 'data'}, '@metadata' => 'value' });

# Or see Log::Dispatch::Message::Passing for a more 'normal' interface to
# simple logging.

# Or use directly on command line:
message-passing --input STDIN --output ZeroMQ --output_options \
    '{"connect":"tcp://192.168.0.1:5552"}'
{"data":{"some":"data"},"@metadata":"value"}

so like β€” you can spin up a logger, call consume on it, or (if you want the more "normal" interface for simple logging) go peep Log::Dispatch::Message::Passing, or just run the whole thing straight from the command line with message-passing. three paths, all iconic πŸ‘‘


✨ DESCRIPTION ✨

it's a Message::Passing ZeroMQ output class, periodt.

you can use it as part of a chain of classes alongside the message-passing utility, or you can just use it directly as a logger in your normal everyday perl apps. both are valid, both are cute 🌈


πŸŽ€ ATTRIBUTES πŸŽ€

peep "CONNECTION ATTRIBUTES" in Message::Passing::ZeroMQ for the deets on those, bestie.

πŸ’œ subscribe_delay

Time in floating seconds to sleep β€” and this is so you can make sure the receiving socket has actually subscribed. it's the longest the sleep might take, so like, don't expect it to always go the full distance.

this exists because of the slow-joiner problem: <http://zguide.zeromq.org/page:all#Getting-the-Message-Out>

DEFAULT: 0.2 seconds


πŸ”₯ METHODS πŸ”₯

🌟 consume ($msg)

Sends a message, as-is. and when I say as-is I mean as-is β€” you must have already encoded the message to a string before sending it. no takebacks, no encoding for you πŸ’€

the message-pass utility will do that encoding for you into JSON, or you can do it manually yourself, exactly like the example shows over in Message::Passing::ZeroMQ.


πŸ‘‘ SEE ALSO πŸ‘‘


πŸ’– SPONSORSHIP πŸ’–

not me getting emotional β€” this module literally exists because of the wonderful people at Suretec Systems Ltd. <http://www.suretecsystems.com/> who sponsored its development for their VoIP division called SureVoIP <http://www.surevoip.co.uk/>, for use with the SureVoIP API β€” <http://www.surevoip.co.uk/support/wiki/api_documentation> 🫢


See Message::Passing. that's where all the author/copyright/license tea lives, bestie ✨


and that's the whole page, no cap πŸ’…

okay so the sign-off: this doc ships with perl v5.32.1, dated 2021-12-22 β€” so go forth and output your messages to ZeroMQ, you absolute main character πŸ¦‹πŸ’–