X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=blobdiff_plain;f=lib%2FObject%2FRemote%2FNode.pm;h=7363f5e885e1330f0eb78136644cd6adebe78ea0;hp=e769e58a61b4d6e63f95a4eba14b2c8346d932a2;hb=a577b9530c7c091e6800bca9dca4fd03c37ce039;hpb=c824fdf36c659b3b6dbafe23a3021f2b1d6eeb3f diff --git a/lib/Object/Remote/Node.pm b/lib/Object/Remote/Node.pm index e769e58..7363f5e 100644 --- a/lib/Object/Remote/Node.pm +++ b/lib/Object/Remote/Node.pm @@ -10,11 +10,7 @@ use CPS::Future; sub run { my ($class, %args) = @_; log_trace { "run() has been invoked on remote node" }; - - if ($args{watchdog_timeout}) { - Object::Remote::WatchDog->new(timeout => $args{watchdog_timeout}); - } - + my $c = Object::Remote::Connector::STDIO->new->connect; $c->register_class_call_handler; @@ -22,7 +18,7 @@ sub run { my $loop = Object::Remote->current_loop; $c->on_close->on_ready(sub { - log_info { "Node connection with call handler has closed" }; + log_debug { "Node connection with call handler has closed" }; $loop->want_stop }); @@ -30,6 +26,16 @@ sub run { print { $c->send_to_fh } "Shere\n"; log_debug { "Node is going to start the run loop" }; + #TODO the alarm should be reset after the run loop starts + #at a minimum - the remote side node should probably send + #a command that clears the alarm in all instances - even + #if the Object::Remote::Watchdog is not being used + if ($args{watchdog_timeout}) { + Object::Remote::WatchDog->new(timeout => $args{watchdog_timeout}); + } else { + #reset connection watchdog from the fatnode + alarm(0); + } $loop->want_run; $loop->run_while_wanted; log_debug { "Run loop invocation in node has completed" };