NAME

MsgPack::RPC::Message::Request - a MessagePack-RPC request

VERSION

version 0.1.0

SYNOPSIS

use MsgPack::RPC;

my $rpc = MsgPack::RPC->new( io => '127.0.0.1:6543' );

$rpc->emit( some_request => 'MsgPack::RPC::Message::Request', args => [ 1..5 ] );

DESCRIPTION

Sub-class of MsgPack::RPC::Message representing an incoming request.

METHODS

new( args => $args, message_id => $id )

Accepts the same argument as MsgPack::RPC::Message, plus message_id, the id of the request.

response

Returns a Future that, once fulfilled, will send a response back with the provided arguments.

$rpc->subscribe( something => sub {
    my $request = shift;
    $request->response->done('a-okay');
});

done($args)

Shortcut for

$request->response->done($args)

fail($args)

Shortcut for

$request->response->fail($args)

AUTHOR

Yanick Champoux <yanick@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Yanick Champoux.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.