title: Best asynchronous while method
body: <p>I need to write some asynchronous code that essentially attempts to repeatedly talk to and initialise a database.  Quite often the first attempt will fail hence the requirement for it to retry.</p>
  
  <p>In days of old I would have used a pattern similar to:</p>
  
  <pre><code>void WaitForItToWork()
  {
      bool succeeded = false;
      while (!succeeded)
      {
          // do work
          succeeded = outcome; // if it worked, mark as succeeded, else retry
          Threading.Thread.Sleep(1000); // arbitrary sleep
      }
  }
  </code></pre>
  
  <p>I realise a lot of changes have been made recently to .NET with regards to async patterns so my question really is this the best method to use or is it worth while exploring the <code>async</code> stuff and if so how do I implement this pattern in <code>async</code>?</p>
  
  <p><strong>Update</strong></p>
  
  <p>Just to clarify, I want to spawn this work asynchronously so that the method which spawns it does not have to wait for it to finish as it will be spawned in the constructor of a service so the constructor must return instantly.</p>