grpc-kotlin icon indicating copy to clipboard operation
grpc-kotlin copied to clipboard

Client example illustrating request cancelation, etc

Open asarkar opened this issue 5 years ago • 6 comments
trafficstars

It'd be helpful to have an example for client-side only for those wanting to talk to an already existing server somewhere.

asarkar avatar Jul 15 '20 21:07 asarkar

How would you expect this to differ from just a part of the existing example? Is the intention just to have something shorter for users who don't need the full example?

lowasser avatar Aug 31 '20 20:08 lowasser

Is the intention just to have something shorter

That, and also to show common client use cases like canceling the RPC call, and sending more requests in response to the server. Both of these are fairly easy to do in Java, but not so much (at least not apparently) using a flow.

asarkar avatar Sep 01 '20 13:09 asarkar

Is the intention just to have something shorter

That, ...

The Hello World client is about 33 non-comment LOC. I'm not sure how much shorter it can be.

talk to an already existing server

You can already run the Hello World client against, say, the Java Greeter server (e.g., #131, #134).

cases like canceling the RPC call, and sending more requests in response to the server. Both of these are fairly easy to do in Java, but not so much (at least not apparently) using a flow.

I'd suggest closing this issue and reopening a new one specifically with the request for example code coving the use cases that you mention. Or at a minimum, change the issue title to more closely reflect the nature of the request.

chalin avatar Sep 16 '20 17:09 chalin

Another thought that comes to mind: maybe a blog post (to be published at https://grpc.io/blog), covering the use cases that you mention, could satisfy your needs? cc @jamesward

chalin avatar Sep 16 '20 17:09 chalin

I think it'd be nice to have an example that covers each feature that is unique to Kotlin. So far this would mean adding the following to the soon-to-be-refactored examples:

  • Cancellation
  • Follow-up requests (non-streaming I believe, but I need more details on the need)

jamesward avatar Sep 16 '20 17:09 jamesward

@jamesward If there's an example for BIDI streaming follow up, that'll be the most generic and cover all the other cases. For completeness sake, the a unary follow up may be shown too, but it's only a special case of streaming one element.

asarkar avatar Sep 16 '20 22:09 asarkar