diff options
author | Mehrdad Afshari <mmx@google.com> | 2017-05-05 10:18:38 -0700 |
---|---|---|
committer | Mehrdad Afshari <mehrdad@afshari.me> | 2017-05-17 23:30:07 -0700 |
commit | 24b6d392125561b73e472dfe954613b6249faf97 (patch) | |
tree | 47c1e5b876f0b0c43f10b848cd60cca4fb3d461f /include/grpc++ | |
parent | 7ee630a3d7a95c3718f4e6d623c61ffc506762d1 (diff) |
Clarified GlobalCallbacks documentation comment
Make it clear that "global" and "per application" means
shared among all grpc::Server instances.
Diffstat (limited to 'include/grpc++')
-rw-r--r-- | include/grpc++/server.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/include/grpc++/server.h b/include/grpc++/server.h index 0fbf841483..5da606cf66 100644 --- a/include/grpc++/server.h +++ b/include/grpc++/server.h @@ -74,10 +74,12 @@ class Server final : public ServerInterface, private GrpcLibraryCodegen { /// call \a Shutdown for this function to ever return. void Wait() override; - /// Global Callbacks - /// - /// Can be set exactly once per application to install hooks whenever - /// a server event occurs + /// Global callbacks are a set of hooks that are called when server + /// events occur. \a SetGlobalCallbacks method is used to register + /// the hooks with gRPC. Note that + /// the \a GlobalCallbacks instance will be shared among all + /// \a Server instances in an application and can be set exactly + /// once per application. class GlobalCallbacks { public: virtual ~GlobalCallbacks() {} @@ -93,9 +95,11 @@ class Server final : public ServerInterface, private GrpcLibraryCodegen { virtual void AddPort(Server* server, const grpc::string& addr, ServerCredentials* creds, int port) {} }; - /// Set the global callback object. Can only be called once. Does not take - /// ownership of callbacks, and expects the pointed to object to be alive - /// until all server objects in the process have been destroyed. + /// Set the global callback object. Can only be called once per application. + /// Does not take ownership of callbacks, and expects the pointed to object + /// to be alive until all server objects in the process have been destroyed. + /// The same \a GlobalCallbacks object will be used throughout the + /// application and is shared among all \a Server objects. static void SetGlobalCallbacks(GlobalCallbacks* callbacks); // Returns a \em raw pointer to the underlying grpc_server instance. |