aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpcpp/impl/codegen/interceptor.h
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2019-01-04 17:20:52 -0800
committerGravatar GitHub <noreply@github.com>2019-01-04 17:20:52 -0800
commit6de81f54bbba10caa79fc72a253c0ea53fa05273 (patch)
treea25bfcde7f1525565dbf8e0a2dcd894318b9e099 /include/grpcpp/impl/codegen/interceptor.h
parentb542cc8917e18e6d921d42cf2308705dedeb3539 (diff)
parent8ba5922e8767e4c10ca38cb46b19d5878c310598 (diff)
Merge pull request #17220 from yashykt/failhijackedsend
Add interceptor method to fail hijacked send messages and get status on POST_SEND_MESSAGE
Diffstat (limited to 'include/grpcpp/impl/codegen/interceptor.h')
-rw-r--r--include/grpcpp/impl/codegen/interceptor.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/grpcpp/impl/codegen/interceptor.h b/include/grpcpp/impl/codegen/interceptor.h
index 5a9a3a44e6..519c65c717 100644
--- a/include/grpcpp/impl/codegen/interceptor.h
+++ b/include/grpcpp/impl/codegen/interceptor.h
@@ -46,9 +46,10 @@ namespace experimental {
/// operation has been requested and it is available. POST_RECV means that a
/// result is available but has not yet been passed back to the application.
enum class InterceptionHookPoints {
- /// The first two in this list are for clients and servers
+ /// The first three in this list are for clients and servers
PRE_SEND_INITIAL_METADATA,
PRE_SEND_MESSAGE,
+ POST_SEND_MESSAGE,
PRE_SEND_STATUS, // server only
PRE_SEND_CLOSE, // client only: WritesDone for stream; after write in unary
/// The following three are for hijacked clients only and can only be
@@ -117,6 +118,10 @@ class InterceptorBatchMethods {
/// only supported for sync and callback APIs at the present moment.
virtual const void* GetSendMessage() = 0;
+ /// Checks whether the SEND MESSAGE op succeeded. Valid for POST_SEND_MESSAGE
+ /// interceptions.
+ virtual bool GetSendMessageStatus() = 0;
+
/// Returns a modifiable multimap of the initial metadata to be sent. Valid
/// for PRE_SEND_INITIAL_METADATA interceptions. A value of nullptr indicates
/// that this field is not valid.
@@ -162,6 +167,10 @@ class InterceptorBatchMethods {
/// started from interceptors without infinite regress through the interceptor
/// list.
virtual std::unique_ptr<ChannelInterface> GetInterceptedChannel() = 0;
+
+ // On a hijacked RPC/ to-be hijacked RPC, this can be called to fail a SEND
+ // MESSAGE op
+ virtual void FailHijackedSendMessage() = 0;
};
/// Interface for an interceptor. Interceptor authors must create a class