Exemplo n.º 1
0
 /// <summary>IAsyncStreamReader Methods.</summary>
 public async Task <bool> MoveNext(CancellationToken cancellationToken = default(CancellationToken))
 {
     if (await innerReader.MoveNext(cancellationToken))
     {
         var data = innerReader.Current;
         logger.ReadFromStream(context, data, typeof(TRequest), false);
         this.Current = LZ4MessagePackSerializer.Deserialize <TRequest>(data, context.FormatterResolver);
         return(true);
     }
     else
     {
         logger.ReadFromStream(context, emptyBytes, typeof(Nil), true);
         return(false);
     }
 }
Exemplo n.º 2
0
        public async Task <bool> MoveNext(CancellationToken cancellationToken)
        {
            var result = await reader.MoveNext(cancellationToken).ConfigureAwait(false);

            logger.ReadFromStream(context, !result);
            return(result);
        }