Is there a way to remove a specific item from a BlockingCollection, like this:
IMyItem mySpecificItem = controller.getTopRequestedItem();
bool took = myBlockingCollection<IMyItem>.TryTake(out mySpecificItem);
if(took)
process(mySpecificItem);
.....
in other words: I want to remove an item from a BlockingCollection<>, which is identified by some field (e.g. ID), not just the next item availible.
Do I need to implement getHashCode() or an IComparer ?
BlockingCollection<>won’t help you here. I think you needConcurrentDictionary<>.