Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gRPC cpp async server vs sync server

Surely a silly question. I don't get the differences between sync and async server.

In gRPC example on github

The distinction in async and sync isn't obvious.

According to this question and with my test sync gRPC server can hanndle parallele request.

And in the asynchronous example the server.Run(); is blocking.

So What's the difference between both ?

like image 647
Erwan Avatar asked Dec 17 '22 21:12

Erwan


1 Answers

I found the answer to my question here

In short,

The async model give the application code full control over threading. Sync can handle multiple requests in parallel, yes, but they are serviced from a gRPC thread pool. If you want finer control over threading, then async is the better model to use

like image 104
Erwan Avatar answered Jan 09 '23 06:01

Erwan