The problem with that is that osproc.waitForExit locks. Rust's try_wait does not lock:
<https://doc.rust-lang.org/std/process/struct.Child.html#method.try_wait> This function will not block the calling thread and will only check to see if the child process has exited or not. If the child has exited then on Unix the process ID is reaped. This function is guaranteed to repeatedly return a successful exit status so long as the child has already exited.
