Exemplo n.º 1
0
        private void Produce(CancellationToken cancellationToken)
        {
            TProducerOutput item;

            while (_producer.GetNext(out item))
            {
                _processingQueue.Enqueue(item);

                if (cancellationToken.IsCancellationRequested)
                {
                    break;
                }
            }

            _producerComplete = true;
        }