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 aEventProcessor
that simply tracks aSequence
.This is useful in tests or for pre-filling a
RingBuffer
from a publisher.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
NoOpEventProcessor.SequencerFollowingSequence
Sequence that follows (by wrapping) another sequence
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicBoolean
running
private NoOpEventProcessor.SequencerFollowingSequence
sequence
-
Constructor Summary
Constructors Constructor Description NoOpEventProcessor(RingBuffer<?> sequencer)
Construct aEventProcessor
that simply tracks aSequence
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Sequence
getSequence()
Get 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
isRunning()
void
run()
-
-
-
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 aEventProcessor
that simply tracks aSequence
object.- Parameters:
sequencer
- to track.
-
-
Method Detail
-
getSequence
public Sequence 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()
- Specified by:
run
in interfacejava.lang.Runnable
-
-