fix some typos in the log messages
[scpubgit/Object-Remote.git] / lib / Object / Remote / Connection.pm
index 136b065..6c10d45 100644 (file)
@@ -23,6 +23,9 @@ BEGIN { router()->exclude_forwarding }
 END {
   log_debug { "Killing all child processes in the process group" };
     
+  #FIXME update along with setpgrp() to not use a process
+  #group anymore
+  
   #send SIGINT to the process group for our children
   kill(1, -2);
 }
@@ -94,6 +97,8 @@ after BUILD => sub {
     
   log_trace { "Setting process group of child process '$pid'" };
   
+  #FIXME moving things into a process group has side effects for
+  #users of the library - move to a list
   setpgrp($self->child_pid, 1);
 };
 
@@ -101,10 +106,20 @@ sub BUILD { }
 
 sub is_valid {
   my ($self) = @_;
-  my $closed = $self->on_close->is_ready;
+  my $valid = ! $self->on_close->is_ready;
+  
+  log_trace {
+    my $id = $self->_id;
+    my $text;
+    if ($valid) {
+      $text = 'yes';
+    } else {
+      $text = 'no';
+    }
+    "Connection '$id' is valid: '$text'"
+  };
   
-  log_trace { "Connection closed: $closed" };
-  return ! $closed;
+  return $valid;
 }
 
 sub _fail_outstanding {
@@ -264,7 +279,7 @@ sub connect {
 sub remote_sub {
   my ($self, $sub) = @_;
   my ($pkg, $name) = $sub =~ m/^(.*)::([^:]+)$/;
-  Dlog_debug { "Invoking remote sub '$sub' for connection $_" } $self->_id;
+  Dlog_debug { "Invoking remote sub '$sub' for connection '$_'" } $self->_id;
   return await_future($self->send_class_call(0, $pkg, can => $name));
 }