public IEnumerable <CatalogImportItem> ReadBuffer()
        {
            if (ReadedCount != -1)
            {
                throw new Exception(@"Уже читается");
            }

            Task.Factory.StartNew(BufferWriterRoutine);

            return(_buffer.PopAsEnumerable());
        }
示例#2
0
        private IEnumerable <PartItem> ReadBuffer()
        {
            int itemsCount = 0;

            foreach (var item in _buffer.PopAsEnumerable())
            {
                _writenCount++;

                yield return(BuildPartItem(item));

                if (itemsCount++ > ContextItemsThreshold)
                {
                    yield break;
                }
            }
        }