1 package Object::Remote::Node;
4 use Object::Remote::Connector::STDIO;
5 use Object::Remote::Logging qw(:log :dlog);
6 use Object::Remote::WatchDog;
10 my ($class, %args) = @_;
11 log_trace { "run() has been invoked on remote node" };
13 my $c = Object::Remote::Connector::STDIO->new->connect;
15 $c->register_class_call_handler;
17 my $loop = Object::Remote->current_loop;
19 $c->on_close->on_ready(sub {
20 log_debug { "Node connection with call handler has closed" };
24 Dlog_trace { "Node is sending 'Shere' to $_" } $c->send_to_fh;
25 print { $c->send_to_fh } "Shere\n";
27 log_debug { "Node is going to start the run loop" };
28 #TODO the alarm should be reset after the run loop starts
29 #at a minimum - the remote side node should probably send
30 #a command that clears the alarm in all instances - even
31 #if the Object::Remote::Watchdog is not being used
32 if ($args{watchdog_timeout}) {
33 Object::Remote::WatchDog->new(timeout => $args{watchdog_timeout});
35 #reset connection watchdog from the fatnode
39 $loop->run_while_wanted;
40 log_debug { "Run loop invocation in node has completed" };