title: Download files in synchronous manner and extract downloaded files asynchronously using C#
body: <p>I have a big list of URLs of some large zip files. I'm downloading files in a loop by using <code>HttpClient</code>. I have to extract the files after the download process. I want to start extracting each file as they finish downloading instead of waiting for the entire download process to complete. File download should happen in a synchronous manner(one by one) and the extraction should happen asynchronously with each downloaded file. My application is using .Net Framework 4.5.2 and C#7.</p>
  <p>In the below code, the file download is also asynchronous. I'm trying to avoid asynchronous downloads because of bandwidth concerns.</p>
  <pre><code>public void DownloadAndExtract()
  {
          IDataReader dr = _myDB.GetFileUrl();
          while (dr.Read())
          {
                  DownloadFile(new Uri(dr[&quot;URL&quot;].ToString())).ContinueWith(task1 =&gt;
                  {
                        var downloadedFilePath = task1.Result.fileName;
                        ExtractFile(downloadedFilePath).GetAwaiter().GetResult();
                  });
           }
           dr.Close();     
   }
  </code></pre>