aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-08-21 16:06:30 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-08-21 16:06:30 -0700
commitb7e22b96865f24b70cbd9ddd96b6882e2b3df771 (patch)
tree6325a91ed40407a6f447280b9b58dd3b6ae9d9dd /include/grpc++
parent849c7ca4b2bbda14dd9531ede3aa31cd86aa8d85 (diff)
parentb7e55a20023b32177cb9b09e8ef0dc0d3cd0aa85 (diff)
Merge github.com:grpc/grpc into y12kdm3
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 516266d3a4..3cff07fb80 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,