add some debugging
[scpubgit/Object-Remote.git] / lib / Object / Remote / MiniLoop.pm
index e7be944..3a5b763 100644 (file)
@@ -16,6 +16,8 @@ has _write_select => (is => 'ro', default => sub { IO::Select->new });
 
 has _timers => (is => 'ro', default => sub { [] });
 
+sub _log { shift; printf "[%s] %s\n", scalar(localtime), join '', @_ }
+
 sub pass_watches_to {
   my ($self, $new_loop) = @_;
   foreach my $fh ($self->_read_select->handles) {
@@ -43,6 +45,7 @@ sub watch_io {
     $self->_write_select->add($fh);
     $self->_write_watches->{$fh} = $cb;
   }
+  return;
 }
 
 sub unwatch_io {
@@ -89,6 +92,7 @@ sub loop_once {
   # differentiate between an error and a timeout.
   #   -- no, love, mst.
   foreach my $fh (@$readable) {
+    $self->_log("got a readable: $fh");
     $read->{$fh}() if $read->{$fh};
   }
   foreach my $fh (@$writeable) {