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
Currently, the library is wrapping the aging XHR API, as the Fetch API hadn't fully supported streaming at the time.
One downside of using the XHR API, is that xhr.responseText grows continuously over the lifetime of the request. This was fine for my original use case, which involved streaming search results from a long running database query, as it was limited to a maximum number of results.
However, for cases where you want to keep the stream open long-term, web sockets would be more appropriate and simpler. So there it least some value in implementing a version based on web sockets. And perhaps this would also work for my original use too?
This implementation would be different enough, that it would likely be better as a distinct library. And it would also require code on the server to setup the web sockets.
Currently, the library is wrapping the aging XHR API, as the Fetch API hadn't fully supported streaming at the time.
One downside of using the XHR API, is that
xhr.responseText
grows continuously over the lifetime of the request. This was fine for my original use case, which involved streaming search results from a long running database query, as it was limited to a maximum number of results.However, for cases where you want to keep the stream open long-term, web sockets would be more appropriate and simpler. So there it least some value in implementing a version based on web sockets. And perhaps this would also work for my original use too?
This implementation would be different enough, that it would likely be better as a distinct library. And it would also require code on the server to setup the web sockets.
Related
jimhigson/oboe.js#241
grpc-ecosystem/grpc-gateway#1783
https://stackoverflow.com/questions/21951175/comet-xmlhttprequest-responsetext-grows-endlessly
The text was updated successfully, but these errors were encountered: