allow waiting on process exit without requiring a mutable borrow and without dropping stdin#19
Open
doy wants to merge 2 commits into
Open
allow waiting on process exit without requiring a mutable borrow and without dropping stdin#19doy wants to merge 2 commits into
doy wants to merge 2 commits into
Conversation
it doesn't need exclusive access
this is a much more useful capability for an async process library, since it is much easier to avoid blocking on this call (since it is a future)
Contributor
Author
|
hey, i was just curious what the status of this was - is there anything i can do to help get it merged? |
Collaborator
|
Thanks for the PR and sorry for the late response. I'm not sure what a good API is to support this (I feel |
Collaborator
|
Also, the signature change of |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
in an async program, it is pretty common to want to be able to wait on something like
read.or(write).or(exit), which isn't actually possible with the current api, since callingstatuscloses stdin, and also requires exclusive access to the child. this kind of structure avoids the deadlock issues thatwaitin the standard library has, and so the decision to close stdin makes a bit less sense.i added this as a new method to avoid breaking the api, but i would also not be opposed to just changing the semantics of the existing
statusmethod. alternate names forstatus_no_dropwould also be good (i couldn't think of anything off the top of my head).