title: Best Practice: Blocking execution while waiting for an Async method
body: <p>I am trying to adapt an existing program (internally written) to use a different library than it originally did.  I've abstracted most of library-specific code away (seems to be the easier part).  </p>
  
  <p>The issue is, the old library would execute a call using a blocking method, and our internal program is expecting a blocking method to be called, but the new library uses an async method.  </p>
  
  <p>I was wondering what the best practice would be for waiting for the async operation to complete.  My first thought was to have a boolean flag called completed, and spin in a while loop until completed == true.</p>
  
  <p>I should note that this is for a quick proof of concept I'm trying to put together for my stakeholder, and if the stakeholders sign off on the project, I'm going to rewrite the offending part of our program.  But for the time being, I need to just wait for the block the function calling the async method until the async call is complete</p>