diff options
author | yang-g <yangg@google.com> | 2015-08-05 15:57:14 -0700 |
---|---|---|
committer | yang-g <yangg@google.com> | 2015-08-05 15:57:14 -0700 |
commit | 8708dd76c1c851329e3da68156497d828d64dcbf (patch) | |
tree | b94751d2c8bb5a01d675edf3b36327c3b45fe49a /include/grpc++ | |
parent | 36f59652470a63b488c78669c96a5351f22e8867 (diff) |
Add WaitForState
Diffstat (limited to 'include/grpc++')
-rw-r--r-- | include/grpc++/channel_interface.h | 10 |
1 files changed, 9 insertions, 1 deletions
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 }; |