diff options
-rw-r--r-- | include/grpc++/channel_interface.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/grpc++/channel_interface.h b/include/grpc++/channel_interface.h index 0ca94dd484..c5a5072298 100644 --- a/include/grpc++/channel_interface.h +++ b/include/grpc++/channel_interface.h @@ -59,16 +59,21 @@ class ChannelInterface : public CallHook, virtual Call CreateCall(const RpcMethod& method, ClientContext* context, CompletionQueue* cq) = 0; + // Get the current channel state. If the channel is in IDLE and try_to_connect + // is set to true, try to connect. virtual grpc_connectivity_state GetState(bool try_to_connect) = 0; + // Return the tag on cq when the channel state is changed or deadline expires. + // GetState needs to called to get the current state. template <typename T> virtual void NotifyOnStateChange(grpc_connectivity_state last_observed, - grpc_connectivity_state* optional_new_state, const T& deadline, CompletionQueue* cq, void* tag) = 0; + + // Blocking wait for channel state change or deadline expires. + // GetState needs to called to get the current state. template <typename T> virtual bool WaitForStateChange(grpc_connectivity_state last_observed, - grpc_connectivity_state* new_state, const T& deadline) = 0; }; |