-
Notifications
You must be signed in to change notification settings - Fork 176
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
Question: connect state #86
Comments
Hey! Glad you like the library! So any of the You can get connection status through the c, err := sse.NewClient("http://my-sse-endpoint.net")
c.OnDisconnect(func(c *sse.Client) {
// log the disconnect
}) If you are interested in making use of those errors, I'm happy to extend the |
Thanks for your answer!
I am using var client = sse.NewClient("https://localhost:3003/api/auth/company/1/group/1/message/event")
if err := client.SubscribeRaw(func(event *sse.Event) {
// foo
}); err != nil {
logger.Fatal(err)
} Edit: Tested with a lot of 401 errors
|
Got it by using the Returning the status code here could be pretty helpful: https://github.com/r3labs/sse/blob/master/client.go#L77 |
Cool, thank you for testing that out. c := NewClient(url)
c.ReconnectStrategy = backoff.WithMaxTries(
backoff.NewExponentialBackOff(),
3,
) The above PR should include the http status in the error |
Thanks @purehyperbole for the info! Just built up this tool for testing our scalable redis sse events and it works great 🎉 |
Hey,
thank you for the great library - just want to ask how i can get informations about the connection progress - how i can retrieve errors when there is e.g. a non 200 status code? Is there something like a connection state?
Thank you!
The text was updated successfully, but these errors were encountered: