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
Could we see some kind of websocket support here or in a seperate avaje-sockets library? It would be nice to be able to have a Spring-like system for them too, in a glimpse I see this guide from Spring with the following sample:
This controller is concise and simple, but plenty is going on. We break it down step by step.
The @MessageMapping annotation ensures that, if a message is sent to the /hello destination, the greeting() method is called.
The payload of the message is bound to a HelloMessage object, which is passed into greeting().
Internally, the implementation of the method simulates a processing delay by causing the thread to sleep for one second. This is to demonstrate that, after the client sends a message, the server can take as long as it needs to asynchronously process the message. The client can continue with whatever work it needs to do without waiting for the response.
After the one-second delay, the greeting() method creates a Greeting object and returns it. The return value is broadcast to all subscribers of /topic/greetings, as specified in the @SendTo annotation. Note that the name from the input message is sanitized, since, in this case, it will be echoed back and re-rendered in the browser DOM on the client side.
This is a pretty beautiful system, but obviously as all things Spring is bloated and obnoxious, and Javalin (and Heildon actually, I've personally zero experience with Heildon so I'm probably stating things you're already aware of) already provides support for websockets.
Javalin has websocket registration right inside of ApiBuilder and I imagine Heildon has a simple system to do so as well, so it shouldn't be too much work to get this to work.
The text was updated successfully, but these errors were encountered:
Yes. The plan is to add support for Websockets. We haven't done it to date because A) haven't hit the need personally plus B) Nima Websockets support is still WIP and it's good to have 2 implementations to target.
My thought was to also support SSE (Server Sent Events) but I need to look at the details there. Javalin has SSE but I need to check that in Helidon.
Could we see some kind of websocket support here or in a seperate
avaje-sockets
library? It would be nice to be able to have a Spring-like system for them too, in a glimpse I see this guide from Spring with the following sample:This is a pretty beautiful system, but obviously as all things Spring is bloated and obnoxious, and Javalin (and Heildon actually, I've personally zero experience with Heildon so I'm probably stating things you're already aware of) already provides support for websockets.
Javalin has websocket registration right inside of ApiBuilder and I imagine Heildon has a simple system to do so as well, so it shouldn't be too much work to get this to work.
The text was updated successfully, but these errors were encountered: