-
Notifications
You must be signed in to change notification settings - Fork 3
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
support reconnection on errors (remote server down, etc) #651
Comments
Hello @jbcpollak! Indeed this on my list of things to improve. IIRC by default, the Today the interface is too much tied to the |
this is true, but doesn't work when the initial connection fails, ie, if the server is not up when you start the process. In our case, we are running an embedded application with a backend process and a kiosk app written with electron and react. The frontend can be up before the backend, so the initial connection can fail. Details here: https://developer.mozilla.org/en-US/docs/Web/API/EventSource/error_event because (I think) the problem only happens on initial connection, you may not need to preserve all of the listeners, though because of the way the lazy loading works I guess you'll have to preserve the first one. |
@samouss: Please add this initial connection check! 🐱 |
I'm currently working with a source that through a proxy that terminates idle connections after 60 seconds. I could solve it with some sort of keepalive, but being able to reconnect would be better. I notice that this package (although kind of outdated) reimplements an event source handler on to of fetch https://github.com/Azure/fetch-event-source and it supports reconnect as well as using methods over than GET |
Hi, does this error still occur? |
Unfortunately I cannot say, we eventually implemented our own ReconnectingEventSource and removed our dependency on the library because it wasn't working for us at the time. |
I tried this library out and the interface is great. I'd love to use it, but I noticed it doesn't support reconnecting when the EventSource errors out. Specifically, something like this would be useful:
The text was updated successfully, but these errors were encountered: