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

Type Parameters:
T - AbstractEntry implementation stored in the RingBuffer

public interface ForceFillProducerBarrier<T extends AbstractEntry>

Abstraction for claiming AbstractEntrys in a RingBuffer while tracking dependent Consumers. This barrier can be used to pre-fill a RingBuffer but only when no other producers are active.


Method Summary
 T claimEntry(long sequence)
          Claim a specific sequence in the RingBuffer when only one producer is involved.
 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()
 

Method Detail

claimEntry

T claimEntry(long sequence)
Claim a specific sequence in the RingBuffer when only one producer is involved.

Parameters:
sequence - to be claimed.
Returns:
the claimed AbstractEntry

commit

void commit(T entry)
Commit an entry back to the RingBuffer to make it visible to Consumers. Only use this method when forcing a sequence and you are sure only one producer exists. This will cause the RingBuffer to advance the RingBuffer.getCursor() to this sequence.

Parameters:
entry - to be committed back to the RingBuffer

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.