Reputation: 40032
Can someone confirm that the below code definitely removes items from the BlockingCollection
foreach (var item in myCollection.GetConsumingEnumerable())
{
//Do stuff
}
It does say on MSDN that it does but I just need to be re-assured as I have a near real time application accepting inputs into 4 of these collections 60ms apart and after a while my app is freezing and I dont know why and just wanted to be sure that items are being removed.
Upvotes: 4
Views: 1087
Reputation: 887469
The documentation says:
Return value:
An IEnumerable that removes and returns items from the collection.
(emphasis added)
Upvotes: 5