IHRingBuffer<TItem> Interface
Namespace: Hazelcast.DistributedObjects
Assembly: Hazelcast.Net.dll
A Ringbuffer is a data-structure where the content is stored in a ring like structure.
public interface IHRingBuffer<TItem> : IDistributedObject, IAsyncDisposable
Inherited Members
Type Parameters
TItem |
Remarks
A Ringbuffer is a data-structure where the content is stored in a ring like structure. A ringbuffer has a capacity so it won't grow beyond that capacity and endanger the stability of the system. If that capacity is exceeded, than the oldest item in the ringbuffer is overwritten. The ringbuffer has 2 always incrementing sequences:
- tailSequence: this is the side where the youngest item is found. So the tail is the side of the ringbuffer where items are added to.
- headSequence: this is the side where the oldest items are found. So the head is the side where items gets discarded.
Properties
Name | Description |
---|---|
MaxBatchSize |
Methods
Name | Description |
---|---|
AddAllAsync(ICollection<TItem>, OverflowPolicy) | Adds all the items of a collection to the tail of the Ringbuffer. |
AddAsync(TItem) | Adds an item to the tail of the Ringbuffer. |
AddAsync(TItem, OverflowPolicy) | Asynchronously writes an item with a configurable OverflowPolicy . If there is space in the ringbuffer, the call will return the sequence of the written item. If there is no space, it depends on the overflow policy what happens:
|
GetCapacityAsync() | Returns the capacity of this Ringbuffer. |
GetHeadSequenceAsync() | Returns the sequence of the head. |
GetRemainingCapacityAsync() | Returns the remaining capacity of the ringbuffer. |
GetSizeAsync() | Returns number of items in the ringbuffer. |
GetTailSequenceAsync() | Returns the sequence of the tail. |
ReadManyAsync(long, int, int) | Reads a batch of items from the Ringbuffer. |
ReadOneAsync(long) | Reads one item from the Ringbuffer. |