Hey grpc community,
I am sorry if it's been asked. I did a very short research and didn't find the answer.
Is it possible for
ClientConn to expose a WaitForConnection API that blocks until connectivity becomes READY? something like
```
func (cc *ClientConn) WaitForConnection(cc *grpc.ClientConn, deadline time.Time) {
ctx := context.Background()
if deadline != time.Time{} {
var cancel context.CancelFunc
ctx, cancel = context.WithDeadline(ctx, deadline)
defer cancel()
}
for {
state := cc.GetState()
if state == connectivity.Ready {
return
}
if !cc.WaitForStateChange(ctx, state) {
return
}
}
}
```
yishu
-- Software Engineer @Dropbox