Mat*_*ite 5 .net collections concurrency
有没有办法从BlockingCollection中删除特定项目,如下所示:
IMyItem mySpecificItem = controller.getTopRequestedItem();
bool took = myBlockingCollection<IMyItem>.TryTake(out mySpecificItem);
if(took)
process(mySpecificItem);
.....
Run Code Online (Sandbox Code Playgroud)
换句话说:我想从BlockingCollection <>中删除一个项目,该项目由某个字段(例如ID)标识,而不仅仅是可用的下一个项目.
我需要实现getHashCode()还是IComparer?