Commit | Line | Data |
47c83a13 |
1 | package Object::Remote::Role::Connector; |
2 | |
84b04178 |
3 | use Module::Runtime qw(use_module); |
47c83a13 |
4 | use Moo::Role; |
5 | |
6 | requires '_open2_for'; |
7 | |
8 | sub connect { |
9 | my $self = shift; |
10 | my %args; |
11 | @args{qw(send_to_fh receive_from_fh child_pid)} = $self->_open2_for(@_); |
12 | my $line = readline($args{receive_from_fh}); |
13 | unless ($line eq "Shere\n") { |
14 | die "New remote container did not send Shere - got ${line}"; |
15 | } |
84b04178 |
16 | return use_module('Object::Remote::Connection')->new(\%args); |
47c83a13 |
17 | } |
18 | |
19 | 1; |