diff options
author | Sree Kuchibhotla <sreek@google.com> | 2016-01-29 18:25:22 -0800 |
---|---|---|
committer | Sree Kuchibhotla <sreek@google.com> | 2016-01-29 18:25:22 -0800 |
commit | 3075c810280b797b5c932c38e0382633cfe3774c (patch) | |
tree | e48190b79d67c590eba176e9f13117d7d489cdc8 /include/grpc++/impl | |
parent | 0f242acb9ddb04100cd234ec986e2092cc088d7f (diff) |
Update comment on TryCancel() API
Diffstat (limited to 'include/grpc++/impl')
-rw-r--r-- | include/grpc++/impl/codegen/server_context.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/include/grpc++/impl/codegen/server_context.h b/include/grpc++/impl/codegen/server_context.h index d3086aef0a..ad08b8210d 100644 --- a/include/grpc++/impl/codegen/server_context.h +++ b/include/grpc++/impl/codegen/server_context.h @@ -106,14 +106,16 @@ class ServerContext { bool IsCancelled() const; // Cancel the Call from the server. This is a best-effort API and depending on - // when this is called, the Call may still appear successful to the client. - // For example, if called on a separate thread, it might race with the - // server handler which might return success to the client before TryCancel() - // was called. + // 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 the - // serverhandler returns Status::CANCELLED if TryCancel() is called (unless - // the serverhandler is already returning an error code) + // 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() { |