-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a non-blocking wait() function for child processes. #1294
Comments
One possible low-tech solution to this problem is to just spawn your command in a separate thread and use a channel to communicate completion (which can be checked in a non-blocking fashion). This may not work for every use case, but I bet it's just fine for a majority of them. Otherwise, something like |
Some time ago I actually wrote a crate for this, although it's generalized a bit more to a timeout as opposed to just a I do think that our process management story needs to be beefed up a little for external extensions (where I think something like this should live first), but I certainly like the idea! |
cc me |
What is the current status of this RFC, please? |
I think this can be closed, now that |
Closing per #1294 (comment). |
Currently the only way to wait on a child is to call wait() which blocks until the child has finished. For some applications, it is more useful to just check if the child has exited without blocking if it hasn't. Usage would be similar to this:
The text was updated successfully, but these errors were encountered: