1 package Object::Remote::Node;
4 use Object::Remote::Connector::STDIO;
5 use Object::Remote::Logging qw(:log :dlog);
6 use Object::Remote::WatchDog;
11 my ($class, %args) = @_;
12 log_trace { "run() has been invoked on remote node" };
14 if ($args{watchdog_timeout}) {
15 Object::Remote::WatchDog->new(timeout => $args{watchdog_timeout});
18 my $c = Object::Remote::Connector::STDIO->new->connect;
20 $c->register_class_call_handler;
22 my $loop = Object::Remote->current_loop;
24 $c->on_close->on_ready(sub {
25 log_info { "Node connection with call handler has closed" };
29 Dlog_trace { "Node is sending 'Shere' to $_" } $c->send_to_fh;
30 print { $c->send_to_fh } "Shere\n";
32 log_debug { "Node is going to start the run loop" };
34 $loop->run_while_wanted;
35 log_debug { "Run loop invocation in node has completed" };