Pcore::RPC::Hub
# client my $hub = Pcore::RPC::Hub->new; $hub->run_rpc( { type => 'RPC', workers => 50, token => undef, listen_events => undef, forward_events => ['APP.SETTINGS_UPDATED'], buildargs => {}, } ); $hub->rpc_call( 'RPC', 'test', @args, $cb ); # server package RPC; use Pcore -rpc, -const, -class; const our $RPC_LISTEN_EVENTS => ['APP.EV2']; const our $RPC_FORWARD_EVENTS => ['APP.EV1']; sub BUILD ( $self, $args ) { return; } sub RPC_ON_CONNECT ( $self, $ws ) { return; } sub RPC_ON_DISCONNECT ( $self, $ws, $status ) { return; } sub API_test ( $self, $req, $args ) { $req->( 200, time ); return; } 1;
To install Pcore, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pcore
CPAN shell
perl -MCPAN -e shell install Pcore
For more information on module installation, please visit the detailed CPAN module installation guide.