Add basics for async wait support #33
Open
+19
−7
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.
Currently, we can only block while we wait for a child process to terminate, which limits in many cases.
A non-blocking version of
wait()
- namedtry_wait()
allows users to implement more features, for example timeouts or async/await support.For the reference: full async/await support could look like this snippet. This requires
tokio
as an additional dependency, thus I haven't added this code to the crate.Availability: If anyone wants to use this and other features before it's merged, check out my temporary fork. It includes #23 #27 #29 #33 #34 #35 and #36 with all conflicts resolved.
Add to your
Cargo.toml
:unshare = { git = "https://github.com/MarkusBauer/unshare.git" }