-
-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow getting native descriptor in Proc::Async.
This takes advantage of recent MoarVM changes in order to allow the created stdout and stderr pipes to be used either for their data (by tapping the returned object) or for the file descriptor. This is done by making `stdout` and `stderr` return a `Proc::Async::Pipe`, which is a subclass of `Supply` (for full back-compat), but with the addition of a `native-descriptor` method that returns a `Promise` that will, when the process is started, be kept with the descriptor. Reading data from stdout/stderr will only commence when the `Supply` has been tapped, rather than immediately after process start. This means that the native descriptor can be obtained without any data being read by the Perl 6 process. The `Promise` returned by `start` now depends on *either* stdout or stderr being read to completion *or* the native descriptor having been obtained instead. So far, this isn't useful for much, but follow-up commits will make it possible to chain the output of one process into the input of another and have the whole lot plumbed together at file descriptor level. This will also be used to fix the synchronous `Proc`, by implementing the `native-descriptor` method on `IO::Pipe`. That way the special case multi for `IO::Pipe` in `Proc::Async` can go away.
- Loading branch information
Showing
3 changed files
with
102 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2017.06-3-g0b45398 | ||
2017.06-13-gc5fc79f |