Package com.lmax.disruptor
Class NoOpEventProcessor
- java.lang.Object
-
- com.lmax.disruptor.NoOpEventProcessor
-
- All Implemented Interfaces:
EventProcessor,java.lang.Runnable
public final class NoOpEventProcessor extends java.lang.Object implements EventProcessor
No operation version of aEventProcessorthat simply tracks aSequence.This is useful in tests or for pre-filling a
RingBufferfrom a publisher.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classNoOpEventProcessor.SequencerFollowingSequenceSequence that follows (by wrapping) another sequence
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicBooleanrunningprivate NoOpEventProcessor.SequencerFollowingSequencesequence
-
Constructor Summary
Constructors Constructor Description NoOpEventProcessor(RingBuffer<?> sequencer)Construct aEventProcessorthat simply tracks aSequenceobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SequencegetSequence()Get a reference to theSequencebeing used by thisEventProcessor.voidhalt()Signal that this EventProcessor should stop when it has finished consuming at the next clean break.booleanisRunning()voidrun()
-
-
-
Field Detail
-
sequence
private final NoOpEventProcessor.SequencerFollowingSequence sequence
-
running
private final java.util.concurrent.atomic.AtomicBoolean running
-
-
Constructor Detail
-
NoOpEventProcessor
public NoOpEventProcessor(RingBuffer<?> sequencer)
Construct aEventProcessorthat simply tracks aSequenceobject.- Parameters:
sequencer- to track.
-
-
Method Detail
-
getSequence
public Sequence 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()
- Specified by:
runin interfacejava.lang.Runnable
-
-