public BatchingPipe <T> Create() { BatchingPipe <T> pipe = new BatchingPipe <T>(); PipeCreatedEvent?.Invoke(this, pipe); return(pipe); }
public IProducer <T> Create() { BatchingPipe <T> pipe = new BatchingPipe <T>(); Add(pipe); return(pipe); }
public PipeMultiplier(int consumerCount) { if (consumerCount <= 0) { throw new ArgumentOutOfRangeException(nameof(consumerCount)); } _pipes = new BatchingPipe <T> [consumerCount]; for (int i = 0; i < consumerCount; i++) { _pipes[i] = new BatchingPipe <T>(); } }
public PipeMultiplexer(int consumerCount, Func <T, int> partitionSelector) { if (consumerCount <= 0) { throw new ArgumentOutOfRangeException(nameof(consumerCount)); } _partitionSelector = partitionSelector ?? throw new ArgumentNullException(nameof(partitionSelector)); _pipes = new BatchingPipe <T> [consumerCount]; for (int i = 0; i < consumerCount; i++) { _pipes[i] = new BatchingPipe <T>(); } }