Commit | Line | Data |
eee9a548 |
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 | |
10 | my $c = Object::Remote::Connector::STDIO->new->connect; |
11 | |
12 | $c->register_class_call_handler; |
13 | |
14 | $c->ready_future->done; |
15 | |
16 | my $loop = Object::Remote->current_loop; |
17 | |
18 | my $f = CPS::Future->new; |
19 | |
20 | $f->on_ready(sub { $loop->want_stop }); |
21 | |
22 | $c->on_close($f); |
23 | |
24 | print { $c->send_to_fh } "Shere\n"; |
25 | |
26 | $loop->want_run; |
27 | $loop->run_while_wanted; |
28 | } |
29 | |
30 | 1; |