aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++/server.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/grpc++/server.h')
-rw-r--r--include/grpc++/server.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/grpc++/server.h b/include/grpc++/server.h
index 1a62df5698..f5fc51ed1f 100644
--- a/include/grpc++/server.h
+++ b/include/grpc++/server.h
@@ -56,6 +56,7 @@ class AsyncGenericService;
class RpcService;
class RpcServiceMethod;
class ServerAsyncStreamingInterface;
+class ServerContext;
class ThreadPoolInterface;
/// Models a gRPC server.
@@ -84,6 +85,17 @@ class Server GRPC_FINAL : public GrpcLibrary, private CallHook {
/// call \a Shutdown for this function to ever return.
void Wait();
+ /// Global Callbacks
+ ///
+ /// Can be set exactly once per application to install hooks whenever
+ /// a server event occurs
+ class GlobalCallbacks {
+ public:
+ virtual void PreSynchronousRequest(ServerContext* context) = 0;
+ virtual void PostSynchronousRequest(ServerContext* context) = 0;
+ };
+ static void SetGlobalCallbacks(GlobalCallbacks* callbacks);
+
private:
friend class AsyncGenericService;
friend class AsynchronousService;