Makes BlockingCollection.GetConsumingEnumerable () removes elements.

Can someone confirm that the code below definitely removes elements from the BlockingCollection

foreach (var item in myCollection.GetConsumingEnumerable()) { //Do stuff } 

He's talking about the MSDN that he does, but I just need to be sure, because I have an application that accepts real-time applications from 4 of these collections 60 ms apart, and after a while my application freezes and I don’t I know why and just wanted to be sure that the elements are deleted.

+4
source share
1 answer

The documentation says:

Return value:
IEnumerable, which removes and returns items from the collection.

(in italics)

+5
source

Source: https://habr.com/ru/post/1382509/


All Articles