From 8708dd76c1c851329e3da68156497d828d64dcbf Mon Sep 17 00:00:00 2001 From: yang-g Date: Wed, 5 Aug 2015 15:57:14 -0700 Subject: Add WaitForState --- include/grpc++/channel_interface.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/grpc++/channel_interface.h b/include/grpc++/channel_interface.h index 65161275c6..335b6ccaae 100644 --- a/include/grpc++/channel_interface.h +++ b/include/grpc++/channel_interface.h @@ -69,10 +69,15 @@ class ChannelInterface : public CallHook, gpr_timespec deadline, CompletionQueue* cq, void* tag) = 0; - // Blocking wait for channel state change or deadline expires. + // Blocking wait for channel state change or deadline expiration. // GetState needs to called to get the current state. virtual bool WaitForStateChange(grpc_connectivity_state last_observed, gpr_timespec deadline) = 0; + + // Blocking wait for target state or deadline expriration. + virtual bool WaitForState(grpc_connectivity_state target_state, + gpr_timespec deadline) = 0; + #ifndef GRPC_CXX0X_NO_CHRONO virtual void NotifyOnStateChange( grpc_connectivity_state last_observed, @@ -81,6 +86,9 @@ class ChannelInterface : public CallHook, virtual bool WaitForStateChange( grpc_connectivity_state last_observed, const std::chrono::system_clock::time_point& deadline) = 0; + virtual bool WaitForState( + grpc_connectivity_state target_state, + const std::chrono::system_clock::time_point& deadline) = 0; #endif // !GRPC_CXX0X_NO_CHRONO }; -- cgit v1.2.3