Argon::Message
use Argon::Message; use Argon qw/:commands :priorities/; my $msg = Argon::Message->new( command => CMD_QUEUE, priority => PRI_NORMAL, ); $msg->set_payload(['Tasks::Adder', [numbers => [3, 4]]); my $reply = $msg->reply(CMD_COMPLETE); $reply->set_payload('Good work!'); my $encoded = $reply->encode; my $decoded = Argon::Message::decode($encoded);
Argon::Message encodes and decodes messages sent across the wire in an Argon cluster.
Returns the unique ID of the message.
Returns the priority of the message.
Returns the message command.
Sets the payload for the message. WARNING: large payloads will result in slow transmission. While the system will not become overly bogged down as a result, individual requests will take significantly longer.
Returns the message's payload.
Encodes the message as a string for transmission over the wire.
Class method: decodes a string into a new Argon::Message.
Returns a new copy of the Argon::Message instance with a different command.
Jeff Ober mailto:jeffober@gmail.com
BSD license
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.