Update comment on TryCancel() API

pull/4958/head
Sree Kuchibhotla 9 years ago
parent 0f242acb9d
commit 3075c81028
  1. 16
      include/grpc++/impl/codegen/server_context.h

@ -106,14 +106,16 @@ class ServerContext {
bool IsCancelled() const; bool IsCancelled() const;
// Cancel the Call from the server. This is a best-effort API and depending on // 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. // when it is called, the RPC may still appear successful to the client.
// For example, if called on a separate thread, it might race with the // For example, if TryCancel() is called on a separate thread, it might race
// server handler which might return success to the client before TryCancel() // with the server handler which might return success to the client before
// was called. // TryCancel() was even started by the thread.
// //
// It is the caller's responsibility to prevent such races and ensure that the // It is the caller's responsibility to prevent such races and ensure that if
// serverhandler returns Status::CANCELLED if TryCancel() is called (unless // TryCancel() is called, the serverhandler must return Status::CANCELLED. The
// the serverhandler is already returning an error code) // 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; void TryCancel() const;
const std::multimap<grpc::string_ref, grpc::string_ref>& client_metadata() { const std::multimap<grpc::string_ref, grpc::string_ref>& client_metadata() {

Loading…
Cancel
Save