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