title: Parallel.ForEach loop with BlockingCollection.GetConsumableEnumerable
body: <p>Why <code>Parallel.ForEach</code> loop exits with <code>OperationCancelledException</code>, while using <code>GetConsumableEnumerable</code>?</p>
  <pre><code>//outside the function
  static BlockingCollection&lt;double&gt; _collection = new BlockingCollection&lt;double&gt;();
      
      
  var t = Task.Factory.StartNew(Producer);            
  Parallel.ForEach(_collection.GetConsumingEnumerable(),
      item =&gt; Console.WriteLine(&quot;Processed {0}&quot;, item));
  Console.WriteLine(&quot;FINISHED processing&quot;);
  
  
  public static void Producer()
  {
       var data = Enumerable.Range(1, 1000);
       foreach (var i in data)
       {
          _collection.Add(i);
          Console.WriteLine(&quot;Added {0}&quot;,i);
       }
                      
       Console.WriteLine(&quot;Finished adding&quot;);
       _collection.CompleteAdding();
  }
  </code></pre>