title: How to keep the RunAsync() method running in the background without calling Wait()?
body: <p>Trying to advance from using BackgroundWorker to Task, I am getting confused on how to keep the background job running without calling Wait().</p>
  
  <p>This is the background job (simplified):</p>
  
  <pre><code>    private async Task RunAsync()
      {
          HttpResponseMessage response = await TheHttpClient.GetAsync(Path);
          if (response.IsSuccessStatusCode)
          {
              textBox_Response.Text = await response.Content.ReadAsStringAsync();
          }
      }
  </code></pre>
  
  <p>When the Send button is clicked, the above code should run, but because the background code has more than one <code>await</code> async calls, I guess that there are several <code>Wait()</code> calls needed:</p>
  
  <pre><code>    private void button_Send_Click(object sender, EventArgs e)
      {
          Task t = RunAsync();
          while (!t.IsCompleted)
          {
              t.Wait();
          }
      }
  </code></pre>
  
  <p>But this would block the GUI during the entire processing time of the background job.</p>
  
  <p>How can I start the background job and return immediately from the button click handler, while allowing the background job to run all async calls?</p>
  
  <p>I know how to achieve this with the BackgroundWorker, should I not use a Task here?</p>