defer node setup
[scpubgit/Object-Remote.git] / lib / Object / Remote / Role / Connector.pm
index 9c7ac7b..16f0d52 100644 (file)
@@ -1,6 +1,6 @@
 package Object::Remote::Role::Connector;
 
-use Object::Remote::Connection;
+use Module::Runtime qw(use_module);
 use Moo::Role;
 
 requires '_open2_for';
@@ -9,11 +9,7 @@ sub connect {
   my $self = shift;
   my %args;
   @args{qw(send_to_fh receive_from_fh child_pid)} = $self->_open2_for(@_);
-  my $line = readline($args{receive_from_fh});
-  unless ($line eq "Shere\n") {
-    die "New remote container did not send Shere - got ${line}";
-  }
-  return Object::Remote::Connection->new(\%args);
+  return use_module('Object::Remote::Connection')->new(\%args);
 }
 
 1;