T - event implementation storing the details for the work to processed.public final class WorkProcessorExt<T>
extends java.lang.Object
implements com.lmax.disruptor.EventProcessor
A WorkProcessorExt wraps a single WorkHandler, effectively consuming the sequence
and ensuring appropriate barriers.
Generally, this will be used as part of a WorkerPool.
| 构造器和说明 |
|---|
WorkProcessorExt(com.lmax.disruptor.RingBuffer<T> ringBuffer,
com.lmax.disruptor.SequenceBarrier sequenceBarrier,
com.lmax.disruptor.WorkHandler<? super T> workHandler,
com.lmax.disruptor.ExceptionHandler<? super T> exceptionHandler,
com.lmax.disruptor.Sequence workSequence)
Construct a
WorkProcessorExt. |
public WorkProcessorExt(com.lmax.disruptor.RingBuffer<T> ringBuffer, com.lmax.disruptor.SequenceBarrier sequenceBarrier, com.lmax.disruptor.WorkHandler<? super T> workHandler, com.lmax.disruptor.ExceptionHandler<? super T> exceptionHandler, com.lmax.disruptor.Sequence workSequence)
WorkProcessorExt.ringBuffer - to which events are published.sequenceBarrier - on which it is waiting.workHandler - is the delegate to which events are dispatched.exceptionHandler - to be called back when an error occursworkSequence - from which to claim the next event to be worked on. It should always be initialised
as Sequencer.INITIAL_CURSOR_VALUEpublic void haltLater()
public com.lmax.disruptor.Sequence getSequence()
getSequence 在接口中 com.lmax.disruptor.EventProcessorpublic void halt()
halt 在接口中 com.lmax.disruptor.EventProcessorpublic boolean isRunning()
isRunning 在接口中 com.lmax.disruptor.EventProcessorpublic void run()
run 在接口中 java.lang.Runnablejava.lang.IllegalStateException - if this processor is already running