public long Add(T item) { ValidationUtil.ThrowExceptionIfNull(item, "Item cannot be null"); var request = RingbufferAddCodec.EncodeRequest(GetName(), (int)OverflowPolicy.Overwrite, ToData(item)); return(Invoke(request, m => RingbufferAddCodec.DecodeResponse(m).response)); }
public Task <long> AddAsync(T item, OverflowPolicy overflowPolicy) { ValidationUtil.ThrowExceptionIfNull(item, "Item cannot be null"); var request = RingbufferAddCodec.EncodeRequest(GetName(), (int)OverflowPolicy.Overwrite, ToData(item)); return(InvokeAsync(request, GetPartitionKey(), m => RingbufferAddCodec.DecodeResponse(m).response)); }
/// <inheritdoc /> public async Task <long> AddAsync(TItem item, OverflowPolicy overflowPolicy) { var itemData = ToSafeData(item); var requestMessage = RingbufferAddCodec.EncodeRequest(Name, (int)overflowPolicy, itemData); var responseMessage = await Cluster.Messaging.SendToPartitionOwnerAsync(requestMessage, PartitionId).CfAwait(); return(RingbufferAddCodec.DecodeResponse(responseMessage).Response); }