public EventHandlerGroup <T> CreateWorkerPool(Sequence[] barrierSequences, IWorkHandler <T>[] workHandlers) { var sequenceBarrier = ringBuffer.NewBarrier(barrierSequences); var workerPool = new WorkerPool <T>(ringBuffer, sequenceBarrier, exceptionHandler, workHandlers); consumerRepository.Add(workerPool, sequenceBarrier); return(new EventHandlerGroup <T>(this, consumerRepository, workerPool.getWorkerSequences())); }
internal EventHandlerGroup <T> CreateWorkerPool(ISequence[] barrierSequences, IWorkHandler <T>[] workHandlers) { var sequenceBarrier = _ringBuffer.NewBarrier(barrierSequences); var workerPool = new WorkerPool <T>(_ringBuffer, sequenceBarrier, _exceptionHandler, workHandlers); _consumerRepository.Add(workerPool, sequenceBarrier); return(new EventHandlerGroup <T>(this, _consumerRepository, workerPool.GetWorkerSequences())); }
public void Add(WorkerPool <T> workerPool, ISequenceBarrier barrier) { var workerPoolInfo = new WorkerPoolInfo <T>(workerPool, barrier); _consumerInfos.Add(workerPoolInfo); foreach (var sequence in workerPool.GetWorkerSequences()) { _eventProcessorInfoBySequence[sequence] = workerPoolInfo; } }
public EventHandlerGroup <T> CreateWorkerPool( ISequence[] barrierSequences, IWorkHandler <T>[] workHandlers) { var barrier = _ringBuffer.NewBarrier(barrierSequences); var workerPool = new WorkerPool <T>(_ringBuffer, barrier, _exceptionHandler, workHandlers); _consumerRepository.Add(workerPool, barrier); var workerSequences = workerPool.GetWorkerSequences(); UpdateGatingSequencesForNextInChain(barrierSequences, workerSequences); return(new EventHandlerGroup <T>(this, _consumerRepository, workerSequences)); }
public WorkerPoolInfo(WorkerPool <T> workerPool, ISequenceBarrier barrier) { _workerPool = workerPool; Barrier = barrier; IsEndOfChain = true; }
public WorkerPoolInfo(WorkerPool <T> workerPool, ISequenceBarrier sequenceBarrier) { this.workerPool = workerPool; this.sequenceBarrier = sequenceBarrier; }