AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

Missleading information about client streaming

Open iamNoah1 opened this issue 2 years ago • 2 comments

[Enter feedback here] The docs on the Section about client streaming say, that this kind of communication works 'without the client sending a message'. The following sentence: 'The client can choose to send messages with RequestStream.WriteAsync' implies that the client can but does not have to send messages to the server.

But according to this, the whole point of client streaming communication is that the client streams messages to the server instead of sending each message using the unary call.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

iamNoah1 avatar Aug 05 '22 08:08 iamNoah1

In the example below AccumulateCount starts a gRPC client streaming call without sending a message. And a client streaming call can complete without one being sent.

I don't know what is misleading here.

var client = new Counter.CounterClient(channel);

// starts call to the server (without sending a message)
using var call = client.AccumulateCount();

// send message (optional)
await call.RequestStream.WriteAsync(new CounterRequest { Count = 1 });

// complete request stream
await call.RequestStream.CompleteAsync();

JamesNK avatar Aug 05 '22 08:08 JamesNK

Thanks for the quick feedback @JamesNK. I found it misleading, because what's the point of client stream method of communication if the client does not send any message at all. My suggestion is to rephrase it a little bit in order to show the difference to the unary call which is: make a call (aka open a stream) and then send messages through that stream vs send separate requests not using a call (aka stream).

What do you think?

iamNoah1 avatar Aug 05 '22 09:08 iamNoah1

Closing this issue. If you feel it should be reopened, feel free to do so.

wadepickett avatar Aug 23 '22 16:08 wadepickett