public ProducerConsumer(Producer <TProduct> producer, Consumer <TProduct> consumer, int bufferCapacity) { Producer = producer; Consumer = consumer; BufferCapacity = bufferCapacity; }
public void Stop() { _subscriber.Dispose(); Producer.Stop(); Consumer.Stop(); }
public void TestInitialize() { _producer = new Producer <int>(() => ++ _counter); _consumer = new Consumer <int>(); _producerConsumer = new ProducerConsumer <int>(_producer, _consumer, 2); }