Commit | Line | Data |
9e72f0cf |
1 | package Object::Remote::Connector::Local; |
2 | |
3 | use IPC::Open2; |
9e72f0cf |
4 | use Moo; |
5 | |
47c83a13 |
6 | with 'Object::Remote::Role::Connector'; |
7 | |
8 | sub _open2_for { |
9e72f0cf |
9 | # XXX bin/ is wrong but meh, fix later |
ad4f54b2 |
10 | my $pid = open2(my $its_stdout, my $its_stdin, 'bin/object-remote-node') |
9e72f0cf |
11 | or die "Couldn't start local node: $!"; |
47c83a13 |
12 | return ($its_stdin, $its_stdout, $pid); |
9e72f0cf |
13 | } |
14 | |
84b04178 |
15 | push @Object::Remote::Connection::Guess, sub { |
16 | if (($_[0]||'') eq '-') { __PACKAGE__->new->connect } |
17 | }; |
18 | |
9e72f0cf |
19 | 1; |