GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Dancer::RPCPlugin::CallbackResult(3) User Contributed Perl Documentation Dancer::RPCPlugin::CallbackResult(3)

Dancer::RPCPlugin::CallbackResult - Factory for generating Callback-results.

    use Dancer::Plugin::RPC::JSONRPC;
    use Dancer::RPCPlugin::CallbackResult;
    jsonrpc '/admin' => {
        publish => 'config',
        callback => sub {
            my ($request, $rpc_method) = @_;
            if ($rpc_method =~ qr/^admin\.\w+$/) {
                return callback_success();
            }
            else {
                return callback_fail(
                    error_code => -32768,
                    error_message => "only admin methods allowed: $rpc_method",
                );
            }
        },
    };

Allows no arguments.

Returns an instantiated Dancer::RPCPlugin::CallbackResult::Success object.

Allows these named arguments:
error_code => $code
error_message => $message

Returns an instantiated Dancer::RPCPlugin::CallbackResult::Fail object.

Dancer::RPCPlugin::CallbackResult::Success - Class for success

Constructor, does not allow any arguments.

Dancer::RPCPlugin::CallbackResult::Fail - Class for failure

Constructor, allows named arguments:
error_code => $code
error_message => $message

(c) MMXVI - Abe Timmerman <abeltje@cpan.org>
2018-06-17 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.