当然是个愚蠢的问题。 我不明白同步服务器和异步服务器之间的区别。
在 github 上的 gRPC 示例中
异步和同步的区别并不明显。
根据这个question并且通过我的测试同步 gRPC 服务器可以处理并行请求。
在异步示例中,server.Run();
处于阻塞状态。
那么两者有什么区别呢?
最佳答案
我找到了问题的答案 here
简而言之,
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
关于c++ - gRPC cpp 异步服务器与同步服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51764721/