title: Await end of Parallel.Invoke() in C#
body: <p>I have the following code : </p>
  
  <pre><code>Parallel.Invoke(
                  () =&gt; this.GetUsers(), 
                  () =&gt; this.GetFrequentVisitors(),
                  () =&gt; this.GetTenantSettings(),
                  () =&gt; this.GetTranslations()
              );
  </code></pre>
  
  <p>All of these are <code>Async Task</code> methods, all of them together take about 30 sec, and in parallel should take about 7.</p>
  
  <p>Right now, if I log time just before and after the <code>Parallel.Invoke</code>, I have less than a second.</p>
  
  <p>My questions are : Why ? And how do I <code>await</code> the <code>.Invoke()</code> so I know when the last of the calls is finished?</p>
  
  <p>Right now I can only achieve what appears to be either everything instantly, which seems wrong, or everything in sequence, which is unbearable for the user.</p>
  
  <p>I have also tried this : </p>
  
  <pre><code>    Task users = this.GetUsers();
      Task visitors = this.GetFrequentVisitors();
      Task settings = this.GetTenantSettings();
      Task translations = this.GetTranslations();
  
  
      Task.WaitAll(users, visitors, settings, translations);
  </code></pre>
  
  <p>Which appears to just hang there forever and blocking my app.</p>
  
  <p>Note : this is in an <code>async Task</code> method which I am awaiting, but there is no await inside (what I showed is the complete method). If I change it I get no different result.</p>
  
  <p>Can anyone help me out a bit? With a little explanation ? I'm struggling with async / threading right now.</p>
  
  <p>Reading this  <a href="https://msdn.microsoft.com/en-us/library/ff963549.aspx" rel="nofollow">article</a> helped a little, but they don't seem to need to <code>await</code> the <code>.Invoke()</code> which surprises me. </p>