create ReadChannel object to allow moving Shere logic into connect
[scpubgit/Object-Remote.git] / lib / Object / Remote / Node.pm
index 7190359..dc2563c 100644 (file)
@@ -6,20 +6,13 @@ use Object::Remote;
 use CPS::Future;
 
 sub run {
-
   my $c = Object::Remote::Connector::STDIO->new->connect;
 
   $c->register_class_call_handler;
 
-  $c->ready_future->done;
-
   my $loop = Object::Remote->current_loop;
 
-  my $f = CPS::Future->new;
-
-  $f->on_ready(sub { $loop->want_stop });
-
-  $c->on_close($f);
+  $c->on_close->on_ready(sub { $loop->want_stop });
 
   print { $c->send_to_fh } "Shere\n";