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=a3f88a5094d431002cff563b077121499ccd1891;hp=a790ba8d2543af7f0f67e623f1e061224e16dc33;hb=bef36e73e4257b2ba8e59eb55661ffc51d8a620a;hpb=8faf2a289aa3409e7cafe2536f943fb43033b086 diff --git a/lib/Object/Remote/Node.pm b/lib/Object/Remote/Node.pm index a790ba8..a3f88a5 100644 --- a/lib/Object/Remote/Node.pm +++ b/lib/Object/Remote/Node.pm @@ -5,29 +5,32 @@ use Object::Remote::Connector::STDIO; use Object::Remote::Logging qw(:log :dlog); use Object::Remote::WatchDog; use Object::Remote; -use CPS::Future; sub run { - my ($class, %args) = @_; + my ($class, %args) = @_; log_trace { "run() has been invoked on remote node" }; - + my $c = Object::Remote::Connector::STDIO->new->connect; - + $c->register_class_call_handler; my $loop = Object::Remote->current_loop; - - $c->on_close->on_ready(sub { - log_info { "Node connection with call handler has closed" }; - $loop->want_stop + + $c->on_close->on_ready(sub { + log_debug { "Node connection with call handler has closed" }; + $loop->want_stop }); Dlog_trace { "Node is sending 'Shere' to $_" } $c->send_to_fh; 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}); + Object::Remote::WatchDog->instance(timeout => $args{watchdog_timeout}); } else { #reset connection watchdog from the fatnode alarm(0);