I have a thread adding items to a BlockingCollection
.
On another thread I am using
foreach (var item in myCollection.GetConsumingEnumerable())
If there is a problem I want to break out of my foreach and my method and clear whatever is left in the BlockingCollection
however I can't find a way to do it.
Any ideas?