public interface RingBuffer
| Modifier and Type | Method and Description |
|---|---|
AtomicBuffer |
buffer()
Get the underlying buffer used by the RingBuffer for storage.
|
int |
capacity()
Get the capacity of the ring-buffer in bytes for exchange.
|
long |
consumerHeartbeatTime()
The time of the last consumer heartbeat.
|
void |
consumerHeartbeatTime(long time)
Set the time of the last consumer heartbeat.
|
long |
consumerPosition()
The position in bytes from start up for the consumers.
|
int |
maxMsgLength()
The maximum message length in bytes supported by the underlying ring buffer.
|
long |
nextCorrelationId()
Get the next value that can be used for a correlation id on an message when a response needs to be correlated.
|
long |
producerPosition()
The position in bytes from start up of the producers.
|
int |
read(MessageHandler handler)
Read as many messages as are available from the ring buffer.
|
int |
read(MessageHandler handler,
int messageCountLimit)
Read as many messages as are available from the ring buffer to up a supplied maximum.
|
int |
size()
Size of the backlog of bytes in the buffer between producers and consumers.
|
boolean |
unblock()
Unblock a multi-producer ring buffer where a producer has died during the act of offering.
|
boolean |
write(int msgTypeId,
DirectBuffer srcBuffer,
int srcIndex,
int length)
Non-blocking write of an message to an underlying ring-buffer.
|
int capacity()
boolean write(int msgTypeId,
DirectBuffer srcBuffer,
int srcIndex,
int length)
msgTypeId - type of the message encoding.srcBuffer - containing the encoded binary message.srcIndex - at which the encoded message begins.length - of the encoded message in bytes.java.lang.IllegalArgumentException - if the length is greater than maxMsgLength()int read(MessageHandler handler)
handler - to be called for processing each message in turn.int read(MessageHandler handler, int messageCountLimit)
handler - to be called for processing each message in turn.messageCountLimit - the number of messages will be read in a single invocation.int maxMsgLength()
long nextCorrelationId()
AtomicBuffer buffer()
void consumerHeartbeatTime(long time)
System.nanoTime()
is not a valid option.time - of the last consumer heartbeat.long consumerHeartbeatTime()
long producerPosition()
long consumerPosition()
int size()
boolean unblock()
Copyright © 2014 - 2016 Real Logic Ltd. All Rights Reserved.