| UR documentation | view source | Contained in the UR distribution. |
UR::Service::RPC::Server - Class for implementing RPC servers
my $executer = Some::Exec::Class->create(fh => $fh); my $server = UR::Service::RPC::Server->create(); $server->add_executer($executer); $server->loop(5); # Process messages for 5 seconds
The RPC server implementation isn't fleshed out very well yet, and may change in the future.
$server->add_executer($exec);
Incorporate a new UR::Service::RPC::Executer instance to this server. It adds the Executer's filehandle to its own internal IO::Select object.
$server->loop(); $server->loop(0); $server->loop($timeout);
Enter the Server's event loop for the given number of seconds. If the timeout
is undef, it will stay in the loop forever. If the timeout is 0, it will make
a single pass though the readable filehandles and call execute on their
Executer objects.
If the return value of an Executer's execute method is false, that Executer's
file handle is removed from the internal Select object.
UR::Service::RPC::Executer, UR::Service::RPC::Message
| UR documentation | view source | Contained in the UR distribution. |