title: java Process.waitfor is a blocking call
body: <p>I want to be able to kick off an external process from within the JVM and reach on its completion.</p>
  
  <p>I could use the ProcessBuilder to create a Process and then do Process.waitFor() to wait for its completion. However, this a blocking call and simply wastes thread resources.</p>
  
  <p>It would make better sense to do this via an event handler and reactive programming. One would think that the JVM could register some sort of a listener with the OS to listen for process completion events, and relay that back to the program.</p>
  
  <p>Does such a mechanism/ API exist? Any alternatives or libraries that achieve this?</p>