title: Comet-Style API Consumption with Async/Await
body: <p>I'm trying to read from a Comet style HTTP API which you connect to and it continuously pushes events. I want this to run in the background after it's started, but my Async/Await is erroneous it's freezing my UI and I don't know why. </p>
  
  <pre><code>private async void button1_Click(object sender, EventArgs e)
  {
      await Task.Run((Func&lt;Task&gt;)PushEventReader);
  }
  
  public async Task PushEventReader()
  {
      var uri = "url.to/api";
      var client = new WebClient();
  
      client.OpenReadCompleted += async (sender, e) =&gt;
      {
          using (var reader = new StreamReader(e.Result))
          {
              while (!reader.EndOfStream)
              {
                  var line = await reader.ReadLineAsync();
                  Console.WriteLine(line);
              }
          }
      };
      await client.OpenReadTaskAsync(new Uri(uri));
  }
  </code></pre>