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 class
Sequence that follows (by wrapping) another sequence -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicBoolean
private final NoOpEventProcessor.SequencerFollowingSequence
-
Constructor Summary
ConstructorsConstructorDescriptionNoOpEventProcessor
(RingBuffer<?> sequencer) Construct aEventProcessor
that simply tracks aSequence
object. -
Method Summary
Modifier and TypeMethodDescriptionGet a reference to theSequence
being used by thisEventProcessor
.void
halt()
Signal that this EventProcessor should stop when it has finished consuming at the next clean break.boolean
void
run()
-
Field Details
-
sequence
-
running
-
-
Constructor Details
-
NoOpEventProcessor
Construct aEventProcessor
that simply tracks aSequence
object.- Parameters:
sequencer
- to track.
-
-
Method Details
-
getSequence
Description copied from interface:EventProcessor
Get a reference to theSequence
being used by thisEventProcessor
.- Specified by:
getSequence
in interfaceEventProcessor
- Returns:
- reference to the
Sequence
for thisEventProcessor
-
halt
public void halt()Description copied from interface:EventProcessor
Signal 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:
halt
in interfaceEventProcessor
-
isRunning
public boolean isRunning()- Specified by:
isRunning
in interfaceEventProcessor
-
run
public void run()
-