-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If disconnected from server. #3
Comments
You could listen on <- ctx.Done() in a separate goroutine to know if context is cancelled. You don't need to call close explicitly but you could call udb.Disconnect or udb.DisconnectContext as it is safe to call disconnect even when connection is already closed (as it internally check the disconnection status and gracefully returns). |
thanks. ctx.Done() doesn't work. to avoid stopping my coding progress, I forked this repo and had added patch and watching if it works. |
Use ctx.Done() when connection is successful and you have other goroutine that need to be notified. A simple example is given below to retry client connection before exiting the application. // Client connection with retry |
I havn't readed all src codes. but I have to make my code works, So I had done some dirty patch, please check if they are ok: |
Is there any notify or chan or something ?
and
We just need reconnect to server. should we close memdb ? anything else ?
The text was updated successfully, but these errors were encountered: