首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >在gRPC中,call_cq和notification_cq有什么不同?

在gRPC中,call_cq和notification_cq有什么不同?
EN

Stack Overflow用户
提问于 2018-07-20 12:36:46
回答 1查看 523关注 0票数 6

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_cqnotification_cq有什么不同呢?使用差异完成队列的潜在用途/好处是什么?

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51435147

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档