parti8al conversion to future based system; start still being weird
[scpubgit/Object-Remote.git] / bin / object-remote-node
index 807f834..acdf165 100755 (executable)
@@ -3,6 +3,7 @@
 use strictures 1;
 use Object::Remote::Connector::STDIO;
 use Object::Remote;
+use CPS::Future;
 
 #$Object::Remote::Connection::DEBUG = 1;
 
@@ -10,7 +11,11 @@ my $c = Object::Remote::Connector::STDIO->new->connect;
 
 my $loop = Object::Remote->current_loop;
 
-$c->on_close(sub { $loop->stop });
+my $f = CPS::Future->new;
+
+$f->on_ready(sub { $loop->stop });
+
+$c->on_close($f);
 
 print { $c->send_to_fh } "Shere\n";