aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++
diff options
context:
space:
mode:
authorGravatar yang-g <yangg@google.com>2015-08-20 12:18:28 -0700
committerGravatar yang-g <yangg@google.com>2015-08-20 12:18:28 -0700
commit961eeb0b44af09b816b9b2aa8e331ac549e6b58b (patch)
tree3ae3ca26c144b9eeeef8bef8623b5692baa607d0 /include/grpc++
parentc317f07b5668d6e081a54ad9f6636555f35e0994 (diff)
parent6f98162b0c8e34476a2188186337a7c29bc6bd10 (diff)
Merge remote-tracking branch 'upstream/master' into docs
Diffstat (limited to 'include/grpc++')
-rw-r--r--include/grpc++/server.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/grpc++/server.h b/include/grpc++/server.h
index 99f288d179..a2bc097c7f 100644
--- a/include/grpc++/server.h
+++ b/include/grpc++/server.h
@@ -63,7 +63,14 @@ class Server GRPC_FINAL : public GrpcLibrary, private CallHook {
~Server();
// Shutdown the server, block until all rpc processing finishes.
- void Shutdown();
+ // Forcefully terminate pending calls after deadline expires.
+ template <class T>
+ void Shutdown(const T& deadline) {
+ ShutdownInternal(TimePoint<T>(deadline).raw_time());
+ }
+
+ // Shutdown the server, waiting for all rpc processing to finish.
+ void Shutdown() { ShutdownInternal(gpr_inf_future(GPR_CLOCK_MONOTONIC)); }
// Block waiting for all work to complete (the server must either
// be shutting down or some other thread must call Shutdown for this
@@ -99,6 +106,8 @@ class Server GRPC_FINAL : public GrpcLibrary, private CallHook {
void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) GRPC_OVERRIDE;
+ void ShutdownInternal(gpr_timespec deadline);
+
class BaseAsyncRequest : public CompletionQueueTag {
public:
BaseAsyncRequest(Server* server, ServerContext* context,