Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Support writing to async proc STDIN also.
Includes an NQP_REVISION bump to get MoarVM improvements that enable
this.
  • Loading branch information
jnthn committed Aug 14, 2014
1 parent b9d499e commit 0bbedab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/core/Proc/Async.pm
Expand Up @@ -21,6 +21,7 @@ my class X::Proc::Async::AlreadyStarted is Exception {
my class Proc::Async {
has $.path;
has @.args;
has $.w;
has Bool $!started;
has $!stdout_supply;
has Bool $!stdout_supply_chars;
Expand Down Expand Up @@ -129,6 +130,7 @@ my class Proc::Async {
});
}
nqp::bindkey($callbacks, 'buf_type', buf8.new);
nqp::bindkey($callbacks, 'write', True) if $.w;

$!process_handle := nqp::spawnprocasync($scheduler.queue,
$args-without, $*CWD.Str, $hash-without, $callbacks);
Expand Down Expand Up @@ -190,6 +192,11 @@ my class Proc::Async {
$p
}

method close_stdin() {
nqp::closefh($!process_handle);
True;
}

method kill($signal = 1) {
nqp::killprocasync($!process_handle, $signal.Int)
}
Expand Down
2 changes: 1 addition & 1 deletion tools/build/NQP_REVISION
@@ -1 +1 @@
2014.07-82-gc2362f4
2014.07-83-gdaaf098

0 comments on commit 0bbedab

Please sign in to comment.