title: Ignoring the return value from an async Task method
body: <p>Here's the scenario: In my WPF app I'd like to keep a loop running at all times that does various things. This pattern came to mind:</p>
  
  <pre><code>    void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
      {
          SomeProcessAsync(); //throw away task
      }
  
      async Task SomeProcessAsync()
      {
          while (true)
          {
              DoSomething();
  
              await Task.Delay(1000);
          }
      }
  </code></pre>
  
  <p>The call triggers a warning since the return value is unused. What is the cleanest way to silence that warning?</p>
  
  <pre><code>#pragma warning disable 4014
              AddItemsAsync(); //throw away task
  #pragma warning restore 4014
  </code></pre>
  
  <p>This works but it looks so nasty!</p>
  
  <p>Btw, I also could have used a timer but I liked the simplicity of this loop.</p>