title: how to run two different asynchronous methods in different threads c#
body: <p>I have a scenario where in My .Net Standard project,I have a api</p>
  <pre><code>public async Task SendMessageAsync(){
  
      await _service1.SendmessageToRestServiceAsync(); - calls a rest service
  
      await _service2.SendMessageToKafkaAsync(); - calls a kakfaclient
  }
  </code></pre>
  <p>The SDK users are using this service concurrently like 100,1000 times and reporting performance issues.</p>
  <pre><code>var tasks  = Enumerable.Range(1, 100).Select(i =&gt;SendMessageAsync());
  await Task.WhenAll(tasks);
  </code></pre>
  <p>I want to run
  <code>await _service1.SendMessage();</code>
  in a way so that if even there is an exception it shouldn't stop
  <code>await _service2.SendMessage();</code></p>
  <p>As this call is mandatory always and shouldn't be affetced. All the concurrent Requests made   for await _service1.Sendmessage();  should be run on a background thread or a different thread so that the performance is not affected.</p>
  <p>I did check the ThreadPool.QueueWorkItem which accepts a delegate but it is return type is void.</p>
  <p>Is there a way to run all the calls to  await _service1.Sendmessage(); in a background.The order of execution is not important.</p>
  <p>The documentation in the link says &quot; Creates a task that will complete when all of the supplied tasks have completed.&quot;
  the SendMessageAsync is already called inside a whenall.
  My question is there a way, the call to SendmessageToRestServiceAsync can be  independent of other task @PeterDuniho –</p>