diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc++/server_context.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/grpc++/server_context.h b/include/grpc++/server_context.h index cf2732b33d..23273f43e6 100644 --- a/include/grpc++/server_context.h +++ b/include/grpc++/server_context.h @@ -125,6 +125,14 @@ class ServerContext { const struct census_context* census_context() const; + // Async only. Has to be called before the rpc starts. + // Returns the tag in completion queue when the rpc finishes. + // IsCancelled() can then be called to check whether the rpc was cancelled. + void AsyncNotifyWhenDone(void* tag) { + has_notify_when_done_tag_ = true; + async_notify_when_done_tag_ = tag; + } + private: friend class ::grpc::testing::InteropContextInspector; friend class ::grpc::Server; @@ -165,6 +173,8 @@ class ServerContext { void set_call(grpc_call* call); CompletionOp* completion_op_; + bool has_notify_when_done_tag_; + void* async_notify_when_done_tag_; gpr_timespec deadline_; grpc_call* call_; |