public T ReadOne(long sequence) { CheckSequence(sequence); var request = RingbufferReadOneCodec.EncodeRequest(GetName(), sequence); var response = Invoke(request, m => RingbufferReadOneCodec.DecodeResponse(m).response); return(ToObject <T>(response)); }
/// <inheritdoc /> public async ValueTask <TItem> ReadOneAsync(long sequence) { if (sequence < 0) { throw new ArgumentOutOfRangeException(nameof(sequence)); } var requestMessage = RingbufferReadOneCodec.EncodeRequest(Name, sequence); var responseMessage = await Cluster.Messaging.SendToPartitionOwnerAsync(requestMessage, PartitionId).CfAwait(); var response = RingbufferReadOneCodec.DecodeResponse(responseMessage).Response; return(ToObject <TItem>(response)); }