use Object::Remote::Future;
use Object::Remote::Logging qw( :log :dlog );
use Scalar::Util qw(blessed);
+use POSIX ":sys_wait_h";
use Moo::Role;
with 'Object::Remote::Role::Connector';
+#TODO ugh breaks some of the stuff in System::Introspector::Util by
+#screwing with status value of child
+BEGIN {
+ $SIG{CHLD} = sub {
+ my $kid;
+ do {
+ $kid = waitpid(-1, WNOHANG);
+ } while $kid > 0;
+ }
+}
+
has module_sender => (is => 'lazy');
#if no child_stderr file handle is specified then stderr
#of the child will be connected to stderr of the parent
has stderr => ( is => 'rw', default => sub { \*STDERR } );
+#has stderr => ( is => 'rw' );
sub _build_module_sender {
my ($hook) =
#TODO only works with ssh with quotes but only works locally
#with out quotes
#sub _build_perl_command { [ 'sh', '-c', '"ulimit -v 80000; nice -n 15 perl -"' ] }
-sub _build_perl_command { [ 'sh', '-c', '"ulimit -v 500000; nice -n 15 perl -"' ] }
+sub _build_perl_command { [ 'sh', '-c', '"ulimit -v 200000; nice -n 15 perl -"' ] }
#sub _build_perl_command { [ 'perl', '-' ] }
around connect => sub {
Dlog_trace { "got $len characters of stderr data for connection" };
print $given_stderr $buf or die "could not send stderr data: $!";
}
- }
+ }
);
}
# my $foreign_stdin,
# @{$self->final_perl_command},
# ) or die "Failed to run perl at '$_[0]': $!";
+#
+# Dlog_trace { "Connection to remote side successful; remote stdin and stdout: $_" } [ $foreign_stdin, $foreign_stdout ];
- Dlog_trace { "Connection to remote side successful; remote stdin and stdout: $_" } [ $foreign_stdin, $foreign_stdout ];
- return ($foreign_stdin, $foreign_stdout, $pid);
+
+ return ($foreign_stdin, $foreign_stdout, $pid);
}
#TODO open2() forks off a child and I have not been able to locate