title: How to query a child process status regularly
body: <p>I have spawned a child process using Rust's <a href="https://doc.rust-lang.org/std/process/struct.Command.html" rel="nofollow noreferrer">Command</a> API.</p>
  
  <p>Now, I need to watch this process for a few seconds before moving on because the process may die early. On success, it should run "forever", so I can't just wait.</p>
  
  <p>There's a nightly feature called <a href="https://doc.rust-lang.org/std/process/struct.Child.html#method.try_wait" rel="nofollow noreferrer">try_wait</a> which does what I want, but I really don't think I should run Rust nightly just for this!</p>
  
  <p>I think I could start a new thread and keep it waiting forever or until the process dies... but I would like to not hang my process with that thread, so maybe run the thread as a daemon might be a solution...</p>
  
  <p>Is this the way to go or is there a nicer solution? </p>