diff options
author | 2017-04-11 16:26:07 -0700 | |
---|---|---|
committer | 2017-04-11 16:26:07 -0700 | |
commit | 334c4678a326284c17254e91a4498728a9c67f69 (patch) | |
tree | 4b2781d55a6c720bc2102f96d136828484745315 /include/grpc++/impl/codegen | |
parent | 2f40ff423ece50964d1041a4ad68939260da9fe6 (diff) |
Start building out C++ interface
Diffstat (limited to 'include/grpc++/impl/codegen')
-rw-r--r-- | include/grpc++/impl/codegen/completion_queue.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/grpc++/impl/codegen/completion_queue.h b/include/grpc++/impl/codegen/completion_queue.h index 61617f2bdc..906a64693e 100644 --- a/include/grpc++/impl/codegen/completion_queue.h +++ b/include/grpc++/impl/codegen/completion_queue.h @@ -289,17 +289,21 @@ class CompletionQueue : private GrpcLibraryCodegen { /// by servers. Instantiated by \a ServerBuilder. class ServerCompletionQueue : public CompletionQueue { public: - bool IsFrequentlyPolled() { return is_frequently_polled_; } + bool IsFrequentlyPolled() { return polling_type_ != GRPC_CQ_NON_LISTENING; } private: - bool is_frequently_polled_; + grpc_cq_polling_type polling_type_; friend class ServerBuilder; /// \param is_frequently_polled Informs the GRPC library about whether the /// server completion queue would be actively polled (by calling Next() or /// AsyncNext()). By default all server completion queues are assumed to be /// frequently polled. - ServerCompletionQueue(bool is_frequently_polled = true) - : is_frequently_polled_(is_frequently_polled) {} + ServerCompletionQueue(grpc_cq_polling_type polling_type) + : CompletionQueue(MakeCompletionQueue(polling_type)), + polling_type_(polling_type) {} + + static grpc_completion_queue* MakeCompletionQueue( + grpc_cq_polling_type polling_type); }; } // namespace grpc |