Scroll to navigation

UR::Service::RPC::Server(3pm) User Contributed Perl Documentation UR::Service::RPC::Server(3pm)

NAME

UR::Service::RPC::Server - Class for implementing RPC servers

SYNOPSIS

  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

DESCRIPTION

The RPC server implementation isn't fleshed out very well yet, and may change in the future.

METHODS

  $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.

SEE ALSO

UR::Service::RPC::Executer, UR::Service::RPC::Message

2019-01-02 perl v5.28.1