aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++/impl/codegen/client_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/grpc++/impl/codegen/client_context.h')
-rw-r--r--include/grpc++/impl/codegen/client_context.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/grpc++/impl/codegen/client_context.h b/include/grpc++/impl/codegen/client_context.h
index 5201808600..aed12767a7 100644
--- a/include/grpc++/impl/codegen/client_context.h
+++ b/include/grpc++/impl/codegen/client_context.h
@@ -221,6 +221,12 @@ class ClientContext {
deadline_ = deadline_tp.raw_time();
}
+ /// EXPERIMENTAL: Set this request to be idempotent
+ void set_idempotent(bool idempotent) { idempotent_ = idempotent; }
+
+ /// EXPERIMENTAL: Trigger fail-fast or not on this request
+ void set_fail_fast(bool fail_fast) { fail_fast_ = fail_fast; }
+
#ifndef GRPC_CXX0X_NO_CHRONO
/// Return the deadline for the client call.
std::chrono::system_clock::time_point deadline() {
@@ -328,9 +334,16 @@ class ClientContext {
grpc_call* call() { return call_; }
void set_call(grpc_call* call, const std::shared_ptr<Channel>& channel);
+ uint32_t initial_metadata_flags() const {
+ return (idempotent_ ? GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST : 0) |
+ (fail_fast_ ? 0 : GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY);
+ }
+
grpc::string authority() { return authority_; }
bool initial_metadata_received_;
+ bool fail_fast_;
+ bool idempotent_;
std::shared_ptr<Channel> channel_;
grpc::mutex mu_;
grpc_call* call_;