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()));
        }
Exemple #2
0
        public void Add(WorkerPool <T> workerPool, ISequenceBarrier sequenceBarrier)
        {
            var workerPoolInfo = new WorkerPoolInfo <T>(workerPool, sequenceBarrier);

            consumerInfos.Add(workerPoolInfo);
            foreach (var sequence in workerPool.getWorkerSequences())
            {
                eventProcessorInfoBySequence[sequence] = workerPoolInfo;
            }
        }