com.lmax.disruptor
Class NoOpConsumer

java.lang.Object
  extended by com.lmax.disruptor.NoOpConsumer
All Implemented Interfaces:
Consumer, java.lang.Runnable

public final class NoOpConsumer
extends java.lang.Object
implements Consumer

No operation version of a Consumer that simply tracks a RingBuffer. This is useful in tests or for pre-filling a RingBuffer from a producer.


Constructor Summary
NoOpConsumer(RingBuffer ringBuffer)
          Construct a Consumer that simply tracks a RingBuffer.
 
Method Summary
 long getSequence()
          Get the sequence up to which this Consumer has consumed AbstractEntrys
 void halt()
          Signal that this Consumer should stop when it has finished consuming at the next clean break.
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoOpConsumer

public NoOpConsumer(RingBuffer ringBuffer)
Construct a Consumer that simply tracks a RingBuffer.

Parameters:
ringBuffer - to track.
Method Detail

getSequence

public long getSequence()
Description copied from interface: Consumer
Get the sequence up to which this Consumer has consumed AbstractEntrys

Specified by:
getSequence in interface Consumer
Returns:
the sequence of the last consumed AbstractEntry

halt

public void halt()
Description copied from interface: Consumer
Signal that this Consumer should stop when it has finished consuming at the next clean break. It will call ConsumerBarrier.alert() to notify the thread to check status.

Specified by:
halt in interface Consumer

run

public void run()
Specified by:
run in interface java.lang.Runnable


Copyright © 2011 LMAX Ltd. All Rights Reserved.