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.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/include/grpc++/impl/codegen/client_context.h b/include/grpc++/impl/codegen/client_context.h
index 012bcc2bbe..387d807c4b 100644
--- a/include/grpc++/impl/codegen/client_context.h
+++ b/include/grpc++/impl/codegen/client_context.h
@@ -62,9 +62,7 @@
#include <grpc++/impl/codegen/sync.h>
#include <grpc++/impl/codegen/time.h>
#include <grpc/impl/codegen/compression_types.h>
-#include <grpc/impl/codegen/log.h>
#include <grpc/impl/codegen/propagation_bits.h>
-#include <grpc/impl/codegen/time.h>
struct census_context;
struct grpc_call;
@@ -225,6 +223,9 @@ class ClientContext {
/// EXPERIMENTAL: Set this request to be idempotent
void set_idempotent(bool idempotent) { idempotent_ = idempotent; }
+ /// EXPERIMENTAL: Set this request to be cacheable
+ void set_cacheable(bool cacheable) { cacheable_ = cacheable; }
+
/// EXPERIMENTAL: Trigger fail-fast or not on this request
void set_fail_fast(bool fail_fast) { fail_fast_ = fail_fast; }
@@ -271,7 +272,7 @@ class ClientContext {
/// Set \a algorithm to be the compression algorithm used for the client call.
///
- /// \param algorith The compression algorithm used for the client call.
+ /// \param algorithm The compression algorithm used for the client call.
void set_compression_algorithm(grpc_compression_algorithm algorithm);
/// Return the peer uri in a string.
@@ -307,6 +308,10 @@ class ClientContext {
};
static void SetGlobalCallbacks(GlobalCallbacks* callbacks);
+ // Should be used for framework-level extensions only.
+ // Applications never need to call this method.
+ grpc_call* c_call() { return call_; }
+
private:
// Disallow copy and assign.
ClientContext(const ClientContext&);
@@ -342,7 +347,8 @@ class ClientContext {
uint32_t initial_metadata_flags() const {
return (idempotent_ ? GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST : 0) |
- (fail_fast_ ? 0 : GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY);
+ (fail_fast_ ? 0 : GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY) |
+ (cacheable_ ? GRPC_INITIAL_METADATA_CACHEABLE_REQUEST : 0);
}
grpc::string authority() { return authority_; }
@@ -350,6 +356,7 @@ class ClientContext {
bool initial_metadata_received_;
bool fail_fast_;
bool idempotent_;
+ bool cacheable_;
std::shared_ptr<Channel> channel_;
grpc::mutex mu_;
grpc_call* call_;