diff options
author | Craig Tiller <ctiller@google.com> | 2016-02-05 10:44:56 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-02-05 10:44:56 -0800 |
commit | 97cb41cfaf65d73f73a2ac2d95555ba52af4cecc (patch) | |
tree | c33f7a303c58422131316f72bf954476bf7be007 /include/grpc++ | |
parent | 9ddf0044d5bb104b69898bff53ec04690e8fa641 (diff) | |
parent | b59b142799fe28482162bc192d6205fcb749c6c4 (diff) |
Merge github.com:grpc/grpc into compress
Diffstat (limited to 'include/grpc++')
-rw-r--r-- | include/grpc++/impl/codegen/server_context.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/grpc++/impl/codegen/server_context.h b/include/grpc++/impl/codegen/server_context.h index 2af9fdaa34..ad08b8210d 100644 --- a/include/grpc++/impl/codegen/server_context.h +++ b/include/grpc++/impl/codegen/server_context.h @@ -105,6 +105,19 @@ class ServerContext { bool IsCancelled() const; + // Cancel the Call from the server. This is a best-effort API and depending on + // when it is called, the RPC may still appear successful to the client. + // For example, if TryCancel() is called on a separate thread, it might race + // with the server handler which might return success to the client before + // TryCancel() was even started by the thread. + // + // It is the caller's responsibility to prevent such races and ensure that if + // TryCancel() is called, the serverhandler must return Status::CANCELLED. The + // only exception is that if the serverhandler is already returning an error + // status code, it is ok to not return Status::CANCELLED even if TryCancel() + // was called. + void TryCancel() const; + const std::multimap<grpc::string_ref, grpc::string_ref>& client_metadata() { return client_metadata_; } |