Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        /// <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));
        }