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

NAME

Beekeeper::JSONRPC::Response - Representation of a JSON-RPC response.

VERSION

Version 0.01

SYNOPSIS

  my $client = Beekeeper::Client->instance;
  
  my $resp = $client->do_job(
      method => 'myapp.svc.foo',
      params => { foo => 'bar' },
  );
  
  die unless ($resp->success);

  print $resp->result;

DESCRIPTION

Objects of this class represents a JSON-RPC response (see http://www.jsonrpc.org/specification).

When a RPC call is made the worker replies with a Beekeeper::JSONRPC::Response object if the invoked method was executed successfully. On error, a Beekeeper::JSONRPC::Error is returned instead.

Method Beekeeper::Client-\do_job> returns objects of this class on success.

ACCESSORS

result

Arbitrary value or data structure returned by the invoked method. It is undefined if the invoked method does not returns anything.

id

The id of the request it is responding to. It is unique per client connection, and it is used for response matching.

success

Always returns true. Used to determine if a method was executed successfully or not ($response->result cannot be trusted as it may be undefined on success).

AUTHOR

José Micó, jose.mico@gmail.com

COPYRIGHT AND LICENSE

Copyright 2015 José Micó.

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

This software is distributed in the hope that it will be useful, but it is provided “as is” and without any express or implied warranties. For details, see the full text of the license in the file LICENSE.