create ReadChannel object to allow moving Shere logic into connect
[scpubgit/Object-Remote.git] / lib / Object / Remote / Connector / STDIO.pm
index 49cb0f9..69ba95d 100644 (file)
@@ -1,7 +1,9 @@
 package Object::Remote::Connector::STDIO;
 
 use File::Spec;
+use IO::Handle;
 use Object::Remote::Connection;
+use Object::Remote::ReadChannel;
 use Moo;
 
 sub connect {
@@ -15,9 +17,9 @@ sub connect {
   open STDIN, '<', File::Spec->devnull or die "Re-opening stdin: $!";
   close STDOUT or die "Closing stdout: $!";
   open STDOUT, '>', File::Spec->devnull or die "Re-opening stdout: $!";
-  Object::Remote::Connection->new(
+  return Object::Remote::Connection->new(
     send_to_fh => $stdout,
-    receive_from_fh => $stdin
+    read_channel => Object::Remote::ReadChannel->new(fh => $stdin)
   );
 }