Proper design for long RPC calls (C++)

184 views
Skip to first unread message

Anh Tran

unread,
Mar 3, 2022, 6:10:50 PM3/3/22
to grpc.io
Hi,

I have a client calling a RPC on the server. The server will then trigger a long running process (could be minutes, could be hours).

Should I put the RPC call in the client into a thread, or should I put the long running task on the server into a thread, assuming that the client doesn't care about the result (we have handling for that already).

I just want to know the proper/de-facto way to do this when using gRPC.

Thanks!

veb...@google.com

unread,
May 26, 2022, 4:55:24 PM5/26/22
to grpc.io
I don't think there is a right way for this. If the client doesn't need to know the result of long-running job, gRPC part would be simple. A server just needs to manage its work; it could be just spawning a dedicated thread handling that job.
If the client needs the result, it's just a normal rpc handling. Client can do sync/async approach here so it's up to you.

Reply all
Reply to author
Forward
0 new messages