create ReadChannel object to allow moving Shere logic into connect
[scpubgit/Object-Remote.git] / lib / Object / Remote / Node.pm
1 package Object::Remote::Node;
2
3 use strictures 1;
4 use Object::Remote::Connector::STDIO;
5 use Object::Remote;
6 use CPS::Future;
7
8 sub run {
9   my $c = Object::Remote::Connector::STDIO->new->connect;
10
11   $c->register_class_call_handler;
12
13   my $loop = Object::Remote->current_loop;
14
15   $c->on_close->on_ready(sub { $loop->want_stop });
16
17   print { $c->send_to_fh } "Shere\n";
18
19   $loop->want_run;
20   $loop->run_while_wanted;
21 }
22
23 1;