grpc-kotlin
grpc-kotlin copied to clipboard
Client example illustrating request cancelation, etc
It'd be helpful to have an example for client-side only for those wanting to talk to an already existing server somewhere.
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?
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.
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.
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
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 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.