com.lmax.disruptor
Interface ProducerBarrier<T extends AbstractEntry>

Type Parameters:
T - AbstractEntry implementation stored in the RingBuffer

public interface ProducerBarrier<T extends AbstractEntry>

Abstraction for claiming AbstractEntrys in a RingBuffer while tracking dependent Consumers


Method Summary
 void commit(SequenceBatch sequenceBatch)
          Commit the batch of entries back to the RingBuffer.
 void commit(T entry)
          Commit an entry back to the RingBuffer to make it visible to Consumers
 long getCursor()
          Delegate a call to the RingBuffer.getCursor()
 T getEntry(long sequence)
          Get the AbstractEntry for a given sequence from the underlying RingBuffer.
 SequenceBatch nextEntries(SequenceBatch sequenceBatch)
          Claim the next batch of AbstractEntrys in sequence.
 T nextEntry()
          Claim the next AbstractEntry in sequence for a producer on the RingBuffer
 

Method Detail

nextEntry

T nextEntry()
Claim the next AbstractEntry in sequence for a producer on the RingBuffer

Returns:
the claimed AbstractEntry

nextEntries

SequenceBatch nextEntries(SequenceBatch sequenceBatch)
Claim the next batch of AbstractEntrys in sequence.

Parameters:
sequenceBatch - to be updated for the batch range.
Returns:
the updated sequenceBatch.

commit

void commit(T entry)
Commit an entry back to the RingBuffer to make it visible to Consumers

Parameters:
entry - to be committed back to the RingBuffer

commit

void commit(SequenceBatch sequenceBatch)
Commit the batch of entries back to the RingBuffer.

Parameters:
sequenceBatch - to be committed.

getEntry

T getEntry(long sequence)
Get the AbstractEntry for a given sequence from the underlying RingBuffer.

Parameters:
sequence - of the AbstractEntry to get.
Returns:
the AbstractEntry for the sequence.

getCursor

long getCursor()
Delegate a call to the RingBuffer.getCursor()

Returns:
value of the cursor for entries that have been published.


Copyright © 2011 LMAX Ltd. All Rights Reserved.