switch from CPS::Future to Future
[scpubgit/Object-Remote.git] / lib / Object / Remote / ReadChannel.pm
index f6a7cca..d2008db 100644 (file)
@@ -1,11 +1,11 @@
 package Object::Remote::ReadChannel;
 
-use CPS::Future;
 use Scalar::Util qw(weaken openhandle);
-use Object::Remote::Logging qw(:log :dlog);
-use POSIX;
+use Object::Remote::Logging qw(:log :dlog router );
 use Moo;
 
+BEGIN { router()->exclude_forwarding }
+
 has fh => (
   is => 'ro', required => 1,
   trigger => sub {
@@ -39,10 +39,7 @@ sub _receive_data_from {
     while (my $cb = $self->on_line_call and $$rb =~ s/^(.*)\n//) {
       $cb->(my $line = $1);
     }
-  #TODO this isn't compatible with Windows but would be if
-  #EAGAIN was set to something that could never match
-  #if on Windows   
-  } elsif ($! != EAGAIN) {
+  } else {
     log_trace { "Got EOF or error, this read channel is done" };
     Object::Remote->current_loop
                   ->unwatch_io(
@@ -58,14 +55,12 @@ sub DEMOLISH {
   my ($self, $gd) = @_;
   return if $gd;
   log_trace { "read channel is being demolished" };
-   
+
   Object::Remote->current_loop
                 ->unwatch_io(
                     handle => $self->fh,
                     on_read_ready => 1
                   );
-                  
-  
 }
 
 1;