难道BlockingCollection.GetConsumingEnumerable()删除项目 [英] Does BlockingCollection.GetConsumingEnumerable() remove items

查看:758
本文介绍了难道BlockingCollection.GetConsumingEnumerable()删除项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以证实,低于code肯定从BlockingCollection删除项目

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

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

它说,在 MSDN 的,它不会,但我只需要重新放心,因为我有一个近乎实时的应用程序接受输入到4这些藏品60ms的分开,过了一段时间我的应用程序被冻结,我不知道为什么,只是想以确保项目被删除。

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.

推荐答案

文档说:

返回值:
  一个IEnumerable说的删除的,并从集合返回项目。

Return value:
An IEnumerable that removes and returns items from the collection.

(强调)

这篇关于难道BlockingCollection.GetConsumingEnumerable()删除项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆