title: How to make a nonblocking wait handle?
body: <p>Essentially, what I'm doing is creating a web server to handle an API call, and then when it's done continue the method execution, so essentially:</p>
  
  <pre><code>new WebServer(myAutoResetEvent);
  myAutoResetEvent.WaitOne();
  </code></pre>
  
  <p>However, this blocks the thread until then. Is there any way to make this async? Is it fine just to wrap it in a <code>await Task.Run()</code> call, i.e. <code>await Task.Run(() =&gt; myAutoResetEvent.WaitOne())</code>?</p>
  
  <p>Thanks!</p>