Argon::Message - Encodable message structure used for cross-system coordination
version 0.17
use Argon::Message; use Argon ':commands', ':priorities'; my $msg = Argon::Message->new( cmd => $PING, pri => $NORMAL, info => {thing => ['with', 'data', 'in', 'it']}, ); my $reply = $msg->reply(info => '...'); my $error = $msg->error("some error message");
Argon protocol messages.
Unique identifier for the conversation. Used to track the course of a task from the client to the manager to the worker and back.
The command verb. See ":commands" in Argon::Constants.
The message priority. See ":priorities" in Argon::Constants.
The data payload of the message. May be a string, reference, et al.
Used internally by Argon::SecureChannel to identify message senders.
Returns true if the cmd is $ERROR.
cmd
$ERROR
Returns true if the cmd is $DENY.
$DENY
Returns a shallow copy of the message with a new id and token.
Returns a copy of the message. Any additional parameters passed are passed transparently to new.
new
Returns a new message with the same id, cmd set to $ERROR, and info set to the supplied error message.
info
Returns the decoded data playload. If the message is an $ERROR or $DENY, croaks with info as the error message. If the message is an $ACK, returns true.
$ACK
Returns a formatted string describing the message. Useful for debugging and logging.
Jeff Ober <sysread@fastmail.fm>
This software is copyright (c) 2017 by Jeff Ober.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Argon, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Argon
CPAN shell
perl -MCPAN -e shell install Argon
For more information on module installation, please visit the detailed CPAN module installation guide.