Reads one item from the Ringbuffer.
Namespace: Hazelcast.Core
Assembly: Hazelcast.Net (in Hazelcast.Net.dll) Version: 3.8.1
Syntax
Parameters
- sequence
- Type: SystemInt64
the sequence of the item to read.
Return Value
Type: Tthe read item
Exceptions
Exception | Condition |
---|---|
StaleSequenceException | if the sequence is smaller then HeadSequence . Because a Ringbuffer won't store all event indefinitely, it can be that the data for the given sequence doesn't exist anymore and the StaleSequenceException is thrown. It is up to the caller to deal with this particular situation, e.g. throw an Exception or restart from the last known head. That is why the StaleSequenceException contains the last known head. |
ArgumentException | if sequence is smaller than 0 or larger than TailSequence +1. |
Exception | if the call is interrupted while blocking. |
Remarks
Ringbuffer<String> ringbuffer = hz.GetRingbuffer("rb"); long seq = ringbuffer.HeadSequence(); while(true){ String item = ringbuffer.ReadOne(seq); seq++; ... process item }
See Also