The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Argon::Message

SYNOPSIS

    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);

DESCRIPTION

Argon::Message encodes and decodes messages sent across the wire in an Argon cluster.

METHODS

id()

Returns the unique ID of the message.

priority()

Returns the priority of the message.

command()

Returns the message command.

set_payload($payload)

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.

get_payload()

Returns the message's payload.

encode()

Encodes the message as a string for transmission over the wire.

decode($line)

Class method: decodes a string into a new Argon::Message.

reply($cmd)

Returns a new copy of the Argon::Message instance with a different command.

AUTHOR

Jeff Ober mailto:jeffober@gmail.com

LICENSE

BSD license