You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.
I would like to use RxJS Dom and Server Sent Event to replace my old web-socket implementation.
With native EventSource, the following code re-establish a connection every 30 seconds (depending of the backend I think)
And after 30 second, I have the onError callback triggered... with the e event which is an exception with type error.
The observable totally stops after that, I don't see any request to the backend (unlike the default EventSource implementation).
I've done an usage with Rx.Observable.create, and it seems to work :
this.downloading$=Rx.Observable.create(o=>{lets=newEventSource('/api/task/downloadManager/downloading');s.onmessage=m=>o.onNext(console.log(JSON.parse(m.data)));s.onerror=e=>o.onError(console.log(e));// Note that this is optional, you do not have to return this if you require no cleanupreturnfunction(){s.close();};});
Could you help or say me if this behavior without re-connection is intentional or if it's a bug ?
Thanks for your help
The text was updated successfully, but these errors were encountered:
Hi,
I would like to use RxJS Dom and Server Sent Event to replace my old web-socket implementation.
With native EventSource, the following code re-establish a connection every 30 seconds (depending of the backend I think)
So I can use this system for constant communication from backend to client (for monitoring change on backend ressources).
But, when I use the Rx.DOM, the connection is correctly initiated but the eventSource is never relaunch, I just have the error due to timeout.
And after 30 second, I have the onError callback triggered... with the
e
event which is an exception with typeerror
.The observable totally stops after that, I don't see any request to the backend (unlike the default EventSource implementation).
I've done an usage with Rx.Observable.create, and it seems to work :
Could you help or say me if this behavior without re-connection is intentional or if it's a bug ?
Thanks for your help
The text was updated successfully, but these errors were encountered: