Reviewer comments

pull/17689/head
Yash Tibrewal 6 years ago
parent 817fb588af
commit 7dd938d5f4
  1. 4
      examples/cpp/keyvaluestore/caching_interceptor.h

@ -27,7 +27,7 @@
#endif #endif
// This is a naive implementation of a cache. A new cache is for each call. For // This is a naive implementation of a cache. A new cache is for each call. For
// each new key request, the key is first searched in the map and if found. Only // each new key request, the key is first searched in the map and if found, the interceptor feeds in the value. Only
// if the key is not found in the cache do we make a request. // if the key is not found in the cache do we make a request.
class CachingInterceptor : public grpc::experimental::Interceptor { class CachingInterceptor : public grpc::experimental::Interceptor {
public: public:
@ -102,8 +102,10 @@ class CachingInterceptor : public grpc::experimental::Interceptor {
*status = grpc::Status::OK; *status = grpc::Status::OK;
} }
if (hijack) { if (hijack) {
// Hijack is called only once when PRE_SEND_INITIAL_METADATA is present in the hook points
methods->Hijack(); methods->Hijack();
} else { } else {
// Proceed is an indicator that the interceptor is done intercepting the batch.
methods->Proceed(); methods->Proceed();
} }
} }

Loading…
Cancel
Save