-
Notifications
You must be signed in to change notification settings - Fork 11
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
/subcription - web sockets or HTTP-SSE ? #199
Comments
Here is the link again, for me the on from Luca didn't work: do you really need websockets. There is also a longer blog entry on microsofts blogs here: micrsofts blog on websockets. I personally have no strong opinion on that as of know, since I didn't implement neither. Not sure how important it is for us to support web browser like (IE, EDGE). Most of our interaction is foreseen to be happening in client API's anyways, or how do you see that? |
One other issue we might face is that we are inside of TU Wien (TUNET) network which restricts certain protocols and ports. With HTTP-SSE we might work around any available restrictions. |
I'm not involved in development and not a developer. Using HTTP-SSE was just a suggestion regarding server to client notifications. I know websockets for bidirectional communication used in chat, online games and social feeds. If it runs on our infrastructure without constraints, its for development to decide - I'm fine either way as long as its tested before going into production. |
Okay, I wrote quite a lot here but the browser crashed just before submitting it. So here's a short version:
Implementation is probably much easier for SSE, expect for the R client. That's the most tempting point for me to switch. Overall WS seems to have slight advantages if we compare pros and cons. Not sure yet, maybe we just need to try it out? I could come up with a SSE specification easily as messages would be the same and it's basically just copy&paste. We could just try it... Some things to consider/check:
|
I haven't looked into SSE vs. Websockets yet, but I think it should not be that difficult to implement it for the R client. I can try to integrate either a C/C++ library or I can use an internal HTML / JS browser from R. The functionality for the subscription boils down to receiving and visualising messages from the server, so this should be possible somehow. |
I am voicing my concerns. I am by no means an expert, just attempting to contribute, note the usage of the word might. Seems like practically the complexity increases and there might even be no need. Not saying it doesn't make sense since Stack Exchange provides a REST API along with a WebSocket API. Leaving links for reference.
All of the links I come across say Websockets VS REST/HTTP. Can someone give an openeo-centric example use case with both the API and the notification service? Would clients really need to keep open connections for so long? Would there need to be separate clients that consume REST and Websockets? Would it make sense to separate a backend into the API and WSS? |
My 2¢ — if I had a choice i'd do away with notifications and just implement polling on the client. Second best IMO would be to go with SSE, because it's more high-level and directly targets our use case (while websockets is totally generic and we'd need to invent something on top). |
We decided on the 3rd year planning to go with polling for now in the Core API. Debugging and error messages will be written to a log, which still has to be added to the API, see #214. As I'd like to experiment with the debug process I'll probably make the WebSocket specification available as an extension. Issue is only open for making it an extension. Can be closed afterwards. |
Closed for now as the WebSocket-based Subscriptions API won't be part of 1.0. We may revisit this in the future. The code for the Subscriptions API is still available in the feature/subscriptions-api branch. |
We have started implementing the /subscription endpoint using web sockets as detailed in the subscriptions api here.
Instead of using web sockets, it is also possible to use HTTP Server Sent Events as suggested by @selloween . See a comparison of the two methods here
Having only one protocol in the API has its advantages in terms of implementation, so I was wondering what is the reason for choosing web sockets instead of HTTP-SSE?
@m-mohr mentioned that browsers may allow only a handful of simultaneous HTTP connections, so this may in fact a reason to go with web sockets.
Did anyone already work a bit on this service (beside Matthias)? Any thoughts?
The text was updated successfully, but these errors were encountered: