Ejemplo n.º 1
0
        public async Task RunAsync(IBidiStreamRequest <WordMessage, ReverseWordMessage> streamRequest, ServerCallContext context)
        {
            await foreach (var word in streamRequest.RequestStream.ReadAllAsync())
            {
                var chars = word.Word.ToCharArray();
                Array.Reverse(chars);
                var reverse = new string(chars);

                await streamRequest.ResponseStream.WriteAsync(new ReverseWordMessage { Word = reverse }).ConfigureAwait(false);
            }
        }
Ejemplo n.º 2
0
        public async Task <Empty> RunAsync(IBidiStreamRequest <TStreamRequest, TStreamResponse> streamRequest, ServerCallContext context)
        {
            await _bidiStreamHandler.RunAsync(streamRequest, context).ConfigureAwait(false);

            return(new Empty());
        }
 public Task RunAsync(IBidiStreamRequest <string, int> streamRequest, ServerCallContext context)
 {
     return(Task.CompletedTask);
 }