[grpc-Java] Best way to async client

1,588 views
Skip to first unread message

Oscar Besga

unread,
Oct 9, 2022, 3:28:12 PM10/9/22
to grpc.io
Greetings all !

I'm developing an open source project with gRPC (an others)

I wish to use asynchronous class between client and server, and I want to know the best way to do it. Even I've been searching, I've not found good answers; so here I'm asking to experienced people.

It is better to make the client asynchronous with streaming on the client / server reponse
or
directly using Server.ServerFututreStub.method and ListenableFuture ?

I rather prefer the second ona as my server emits only one response to the client y the gRPC calls, and can male it wait a while.

Thanks

Sergii Tkachenko

unread,
Oct 20, 2022, 2:38:49 PM10/20/22
to grpc.io
Greetings to you too!

A good place to start is Bidirectional streaming RPC sections of gRPC Java basic tutorial.
Next, there are blog posts So You Want to Optimize gRPC - Part 1 and So You Want to Optimize gRPC - Part 2, which look into differences between non-blocking stubs and the Listenable Future API.

I hope this helps.

Best regards,
Sergii
Reply all
Reply to author
Forward
0 new messages