Skip to content
Snippets Groups Projects
Commit 0e314bcc authored by Craig Tiller's avatar Craig Tiller
Browse files

Merge branch 'server_channel_affinity' of github.com:sreecha/grpc into test_affine

parents aae6c2cb fa92da7d
No related branches found
No related tags found
No related merge requests found
...@@ -100,11 +100,8 @@ void ServerBuilder::AddListeningPort(const grpc::string& addr, ...@@ -100,11 +100,8 @@ void ServerBuilder::AddListeningPort(const grpc::string& addr,
std::unique_ptr<Server> ServerBuilder::BuildAndStart() { std::unique_ptr<Server> ServerBuilder::BuildAndStart() {
std::unique_ptr<ThreadPoolInterface> thread_pool; std::unique_ptr<ThreadPoolInterface> thread_pool;
// Does this server have atleast one sync method
bool has_sync_methods = false;
for (auto it = services_.begin(); it != services_.end(); ++it) { for (auto it = services_.begin(); it != services_.end(); ++it) {
if ((*it)->service->has_synchronous_methods()) { if ((*it)->service->has_synchronous_methods()) {
has_sync_methods = true;
if (thread_pool == nullptr) { if (thread_pool == nullptr) {
thread_pool.reset(CreateDefaultThreadPool()); thread_pool.reset(CreateDefaultThreadPool());
break; break;
...@@ -146,10 +143,10 @@ std::unique_ptr<Server> ServerBuilder::BuildAndStart() { ...@@ -146,10 +143,10 @@ std::unique_ptr<Server> ServerBuilder::BuildAndStart() {
if ((*cq)->IsFrequentlyPolled()) { if ((*cq)->IsFrequentlyPolled()) {
grpc_server_register_completion_queue(server->server_, (*cq)->cq(), grpc_server_register_completion_queue(server->server_, (*cq)->cq(),
nullptr); nullptr);
num_frequently_polled_cqs++;
} else { } else {
grpc_server_register_non_listening_completion_queue(server->server_, grpc_server_register_non_listening_completion_queue(server->server_,
(*cq)->cq(), nullptr); (*cq)->cq(), nullptr);
num_non_listening_cqs++;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment