JSON::RPC::Legacy::Procedure(3pm)

JSON::RPC::Legacy::Procedure3pm

Json-rpc service attributes

Usage

 package MyApp;
 
 use base ('JSON::RPC::Legacy::Procedure');
 
 sub sum : Public {
     my ($s, @arg) = @_;
     return $arg[0] + $arg[1];
 }
 
 # or 
 
 sub sum : Public(a, b) {
     my ($s, $obj) = @_;
     return $obj->{a} + $obj->{b};
 }
 
 # or 
 
 sub sum : Number(a:num, b:num) {
     my ($s, $obj) = @_;
     return $obj->{a} + $obj->{b};
 }
 
 # private method can't be called by clients
 
 sub _foobar : Private {
     # ...
 }

Overview

Using this module, you can write a subroutine with a special attribute.

Currently, in below attributes, only Public and Private are available. Others are same as Public.

Public

Means that a client can call this procedure.

Private

Means that a client can't call this procedure.

Arr

Means that its return values is an array object.

Obj

Means that its return values is a member object.

Bit
Bool

Means that a return values is a "true" or "false".

Num

Means that its return values is a number.

Str

Means that its return values is a string.

Nil
None

Means that its return values is a "null".

Todo

Auto Service Description
Type check

Releases

6 releases since Debian 8 (Jessie); the text changed 4 times.

  1. 8
  2. 9–10
  3. 11
  4. 12
  5. 13

Author

Makamaka Hannyaharamitu, <makamaka[at]cpan.org>

From libjson-rpc-perl 1.06-4 in Debian 13 (Trixie). Parsed by carta from the page's man source.