Hello etcd-dev,
Could you please recommend me the best approach for an asynchronous detection of clientv3 re-connection? I have searched through the clientv3 implementation as well as through grpc a little bit, but couldn't find any channels/callbacks/etc. through which connection status changes get propagated upwards.
My current approach is rather silly: a separate goroutine is repeatedly attempting to read some random key inside a context with 2 seconds timeout. If the timeout runs out before a response is returned, the connection is considered to be broken (like a ping).
Firstly, this is not quite accurate under all possible scenarious and secondly not as efficient as I would like it to be.
I'm especially interested in the event of connection re-establishment, at which I'm running a procedure that reloads a range of keys to check if something has been added/changed/deleted while the connection of my client was down (basically to handle lost notifications).
Is there a better way to get signaled about the connection status changes?
Thanks,
Milan