Search in sources :

Example 1 with WorkerPool

use of com.lmax.disruptor.WorkerPool in project disruptor by LMAX-Exchange.

the class Disruptor method createWorkerPool.

EventHandlerGroup<T> createWorkerPool(final Sequence[] barrierSequences, final WorkHandler<? super T>[] workHandlers) {
    final SequenceBarrier sequenceBarrier = ringBuffer.newBarrier(barrierSequences);
    final WorkerPool<T> workerPool = new WorkerPool<T>(ringBuffer, sequenceBarrier, exceptionHandler, workHandlers);
    consumerRepository.add(workerPool, sequenceBarrier);
    Sequence[] workerSequences = workerPool.getWorkerSequences();
    updateGatingSequencesForNextInChain(barrierSequences, workerSequences);
    return new EventHandlerGroup<T>(this, consumerRepository, workerSequences);
}
Also used : WorkerPool(com.lmax.disruptor.WorkerPool) SequenceBarrier(com.lmax.disruptor.SequenceBarrier) Sequence(com.lmax.disruptor.Sequence)

Aggregations

Sequence (com.lmax.disruptor.Sequence)1 SequenceBarrier (com.lmax.disruptor.SequenceBarrier)1 WorkerPool (com.lmax.disruptor.WorkerPool)1