Click or drag to resize

IRingbufferT Methods

The IRingbufferT generic type exposes the following members.

Methods
  NameDescription
Public methodAdd
Adds an item to the tail of the Ringbuffer.
Public methodAddAllAsyncTE
Adds all the items of a collection to the tail of the Ringbuffer.
Public methodAddAsync
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:
  1. Overwrite : we just overwrite the oldest item in the ringbuffer and we violate the ttl
  2. Fail : we return -1
The reason that FAIL exist is to give the opportunity to obey the ttl. If blocking behavior is required, this can be implemented using retrying in combination with a exponential backoff. Example:
int sleepMs = 100;
for (; ; ) {
long result = ringbuffer.AddAsync(item, OverflowPolicy.Fail).Result;
if (result != -1) {
break;
}
Thread.Sleep(sleepMs);
sleepMs = Math.Min(5000, sleepMs * 2);
}
Public methodCapacity
Returns the capacity of this Ringbuffer.
Public methodDestroy
Destroys this object cluster-wide.
(Inherited from IDistributedObject.)
Public methodGetName
Returns the unique name for this IDistributedObject.
(Inherited from IDistributedObject.)
Public methodGetPartitionKey
Returns the key of partition this IDistributedObject is assigned to.
(Inherited from IDistributedObject.)
Public methodGetServiceName
Returns the service name for this object.
(Inherited from IDistributedObject.)
Public methodHeadSequence
Returns the sequence of the head.
Public methodReadManyAsync
Reads a batch of items from the Ringbuffer.
Public methodReadOne
Reads one item from the Ringbuffer.
Public methodRemainingCapacity
Returns the remaining capacity of the ringbuffer.
Public methodSize
Returns number of items in the ringbuffer.
Public methodTailSequence
Returns the sequence of the tail.
Top
See Also