aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpcpp/server.h
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2018-10-08 13:28:10 -0700
committerGravatar Vijay Pai <vpai@google.com>2018-10-29 13:41:25 -0700
commit84e763f10a1e10d36c7de35970f9d25958ee2e16 (patch)
tree0aeb2dfa3ac8a6ec9d829989cb99d70ee20fa8eb /include/grpcpp/server.h
parentccfd919190babf042c2876e6b94fa38a2508b424 (diff)
Experimental C++ server callback unary API
Diffstat (limited to 'include/grpcpp/server.h')
-rw-r--r--include/grpcpp/server.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/grpcpp/server.h b/include/grpcpp/server.h
index 2b89ffd317..ef54a218a7 100644
--- a/include/grpcpp/server.h
+++ b/include/grpcpp/server.h
@@ -202,6 +202,7 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
friend class ServerInitializer;
class SyncRequest;
+ class CallbackRequest;
class UnimplementedAsyncRequest;
class UnimplementedAsyncResponse;
@@ -224,6 +225,8 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
return max_receive_message_size_;
};
+ CompletionQueue* CallbackCQ() override;
+
ServerInitializer* initializer();
const int max_receive_message_size_;
@@ -238,6 +241,9 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
/// the \a sync_server_cqs)
std::vector<std::unique_ptr<SyncRequestThreadManager>> sync_req_mgrs_;
+ /// Outstanding callback requests
+ std::vector<std::unique_ptr<CallbackRequest>> callback_reqs_;
+
// Server status
std::mutex mu_;
bool started_;
@@ -264,6 +270,13 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
std::vector<std::unique_ptr<experimental::ServerInterceptorFactoryInterface>>
interceptor_creators_;
+
+ // callback_cq_ references the callbackable completion queue associated
+ // with this server (if any). It is set on the first call to CallbackCQ().
+ // It is _not owned_ by the server; ownership belongs with its internal
+ // shutdown callback tag (invoked when the CQ is fully shutdown).
+ // It is protected by mu_
+ CompletionQueue* callback_cq_ = nullptr;
};
} // namespace grpc