Provides a consuming IEnumerable`1 for items in the collection.
![]()
An IEnumerable`1 that removes and returns items from the collection.
This method enables client code to remove items from the collection by using a foreach loop (For Each in Visual Basic), or System.Threading.Tasks.Parallel.ForEach``1(Partitioner<``0>, Action<``0>) or a PLINQ query. The enumerator will continue to provide items (if any exist) until BlockingCollection`1.IsCompleted returns true, and if BlockingCollection`1.IsCompleted is false the loop blocks until an item becomes available or until the System.Threading.CancellationToken is cancelled.