|
|
|
@ -68,14 +68,14 @@ ServerBuilder::~ServerBuilder() { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::unique_ptr<ServerCompletionQueue> ServerBuilder::AddCompletionQueue( |
|
|
|
|
std::unique_ptr<grpc_impl::ServerCompletionQueue> ServerBuilder::AddCompletionQueue( |
|
|
|
|
bool is_frequently_polled) { |
|
|
|
|
ServerCompletionQueue* cq = new ServerCompletionQueue( |
|
|
|
|
grpc_impl::ServerCompletionQueue* cq = new grpc_impl::ServerCompletionQueue( |
|
|
|
|
GRPC_CQ_NEXT, |
|
|
|
|
is_frequently_polled ? GRPC_CQ_DEFAULT_POLLING : GRPC_CQ_NON_LISTENING, |
|
|
|
|
nullptr); |
|
|
|
|
cqs_.push_back(cq); |
|
|
|
|
return std::unique_ptr<ServerCompletionQueue>(cq); |
|
|
|
|
return std::unique_ptr<grpc_impl::ServerCompletionQueue>(cq); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ServerBuilder& ServerBuilder::RegisterService(Service* service) { |
|
|
|
@ -289,9 +289,9 @@ std::unique_ptr<grpc::Server> ServerBuilder::BuildAndStart() { |
|
|
|
|
// This is different from the completion queues added to the server via
|
|
|
|
|
// ServerBuilder's AddCompletionQueue() method (those completion queues
|
|
|
|
|
// are in 'cqs_' member variable of ServerBuilder object)
|
|
|
|
|
std::shared_ptr<std::vector<std::unique_ptr<ServerCompletionQueue>>> |
|
|
|
|
std::shared_ptr<std::vector<std::unique_ptr<grpc_impl::ServerCompletionQueue>>> |
|
|
|
|
sync_server_cqs(std::make_shared< |
|
|
|
|
std::vector<std::unique_ptr<ServerCompletionQueue>>>()); |
|
|
|
|
std::vector<std::unique_ptr<grpc_impl::ServerCompletionQueue>>>()); |
|
|
|
|
|
|
|
|
|
bool has_frequently_polled_cqs = false; |
|
|
|
|
for (const auto& cq : cqs_) { |
|
|
|
@ -320,7 +320,7 @@ std::unique_ptr<grpc::Server> ServerBuilder::BuildAndStart() { |
|
|
|
|
// Create completion queues to listen to incoming rpc requests
|
|
|
|
|
for (int i = 0; i < sync_server_settings_.num_cqs; i++) { |
|
|
|
|
sync_server_cqs->emplace_back( |
|
|
|
|
new ServerCompletionQueue(GRPC_CQ_NEXT, polling_type, nullptr)); |
|
|
|
|
new grpc_impl::ServerCompletionQueue(GRPC_CQ_NEXT, polling_type, nullptr)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|