【发布时间】:2018-12-28 07:54:18
【问题描述】:
https://github.com/grpc/grpc/blob/master/examples/cpp/helloworld/greeter_async_server.cc#L91
service_->RequestSayHello(&ctx_, &request_, &responder_, cq_, cq_,
this);
cq_ 的两次出现对我来说看起来很奇怪,所以我深入研究了导致我的源代码
https://github.com/grpc/grpc/blob/master/include/grpcpp/impl/codegen/service_type.h#L92
void RequestAsyncUnary(int index, ServerContext* context, Message* request,
internal::ServerAsyncStreamingInterface* stream,
CompletionQueue* call_cq,
ServerCompletionQueue* notification_cq, void* tag) {
server_->RequestAsyncCall(methods_[index].get(), context, stream, call_cq,
notification_cq, tag, request);
}
那么call_cq 和notification_cq 有什么区别?使用差异完成队列的潜在用途/好处是什么?
【问题讨论】:
标签: grpc