Package org.agrona
Interface ExpandableRingBuffer.MessageConsumer
- Enclosing class:
- ExpandableRingBuffer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Consumers of messages implement this interface and pass it to
ExpandableRingBuffer.consume(MessageConsumer, int).-
Method Summary
Modifier and TypeMethodDescriptionbooleanonMessage(MutableDirectBuffer buffer, int offset, int length, int headOffset) Called for the processing of each message from a buffer in turn.
-
Method Details
-
onMessage
Called for the processing of each message from a buffer in turn. Returning false aborts consumption so that current message remains and any after it.- Parameters:
buffer- containing the encoded message.offset- at which the encoded message begins.length- in bytes of the encoded message.headOffset- how much of an offset fromExpandableRingBuffer.head()has passed for the end of this message.- Returns:
- true is the message was consumed otherwise false. Returning false aborts further consumption.
-