public final class NoOpEventProcessor extends java.lang.Object implements EventProcessor
EventProcessor
that simply tracks a Sequence
.
This is useful in tests or for pre-filling a RingBuffer
from a publisher.
Modifier and Type | Class and Description |
---|---|
private static class |
NoOpEventProcessor.SequencerFollowingSequence
Sequence that follows (by wrapping) another sequence
|
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.atomic.AtomicBoolean |
running |
private NoOpEventProcessor.SequencerFollowingSequence |
sequence |
Constructor and Description |
---|
NoOpEventProcessor(RingBuffer<?> sequencer)
Construct a
EventProcessor that simply tracks a Sequence object. |
Modifier and Type | Method and Description |
---|---|
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.
|
boolean |
isRunning() |
void |
run() |
private final NoOpEventProcessor.SequencerFollowingSequence sequence
private final java.util.concurrent.atomic.AtomicBoolean running
public NoOpEventProcessor(RingBuffer<?> sequencer)
EventProcessor
that simply tracks a Sequence
object.sequencer
- to track.public Sequence getSequence()
EventProcessor
Sequence
being used by this EventProcessor
.getSequence
in interface EventProcessor
Sequence
for this EventProcessor
public void halt()
EventProcessor
SequenceBarrier.alert()
to notify the thread to check status.halt
in interface EventProcessor
public boolean isRunning()
isRunning
in interface EventProcessor
public void run()
run
in interface java.lang.Runnable