Package com.lmax.disruptor
Class NoOpEventProcessor
java.lang.Object
com.lmax.disruptor.NoOpEventProcessor
- All Implemented Interfaces:
EventProcessor,Runnable
No operation version of a
EventProcessor that simply tracks a Sequence.
This is useful in tests or for pre-filling a RingBuffer from a publisher.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classSequence that follows (by wrapping) another sequence -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicBooleanprivate final NoOpEventProcessor.SequencerFollowingSequence -
Constructor Summary
ConstructorsConstructorDescriptionNoOpEventProcessor(RingBuffer<?> sequencer) Construct aEventProcessorthat simply tracks aSequenceobject. -
Method Summary
Modifier and TypeMethodDescriptionGet a reference to theSequencebeing used by thisEventProcessor.voidhalt()Signal that this EventProcessor should stop when it has finished consuming at the next clean break.booleanvoidrun()
-
Field Details
-
sequence
-
running
-
-
Constructor Details
-
NoOpEventProcessor
Construct aEventProcessorthat simply tracks aSequenceobject.- Parameters:
sequencer- to track.
-
-
Method Details
-
getSequence
Description copied from interface:EventProcessorGet a reference to theSequencebeing used by thisEventProcessor.- Specified by:
getSequencein interfaceEventProcessor- Returns:
- reference to the
Sequencefor thisEventProcessor
-
halt
public void halt()Description copied from interface:EventProcessorSignal that this EventProcessor should stop when it has finished consuming at the next clean break. It will callSequenceBarrier.alert()to notify the thread to check status.- Specified by:
haltin interfaceEventProcessor
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceEventProcessor
-
run
public void run()
-