|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.lmax.disruptor.WorkProcessor<T>
T - event implementation storing the details for the work to processed.public final class WorkProcessor<T>
WorkProcessor for ensuring each sequence is handled by only a single processor, effectively consuming the sequence.
No other WorkProcessors in the WorkerPool will consume the same sequence.
| Constructor Summary | |
|---|---|
WorkProcessor(RingBuffer<T> ringBuffer,
SequenceBarrier sequenceBarrier,
WorkHandler<T> workHandler,
ExceptionHandler exceptionHandler,
Sequence workSequence)
Construct a WorkProcessor. |
|
| Method Summary | |
|---|---|
Sequence |
getSequence()
Get a reference to the Sequence being used by this EventProcessor. |
void |
halt()
Signal that this EventProcessor should stop when it has finished consuming at the next clean break. |
void |
run()
It is ok to have another thread re-run this method after a halt(). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WorkProcessor(RingBuffer<T> ringBuffer,
SequenceBarrier sequenceBarrier,
WorkHandler<T> workHandler,
ExceptionHandler exceptionHandler,
Sequence workSequence)
WorkProcessor.
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_VALUE| Method Detail |
|---|
public Sequence getSequence()
EventProcessorSequence being used by this EventProcessor.
getSequence in interface EventProcessorSequence for this EventProcessorpublic void halt()
EventProcessorSequenceBarrier.alert() to notify the thread to check status.
halt in interface EventProcessorpublic void run()
run in interface java.lang.Runnable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||