users@jax-rs-spec.java.net

[jax-rs-spec users] Re: Server Sent Events

From: <vrolijken_at_yahoo.com>
Date: Thu, 9 Mar 2017 10:53:28 +0100

Hi Pavel,

Thanks for the feedback. I really meant process. Our flow is like this:
1. The user visits a site and starts listening for SSE
2. The site sends the user to an app on their phone
3. The user does something in the app and sends the result to the app’s server
4. The app’s server invokes the callback URI
5. An event is sent to the user

The managing of the SseEventSink now becomes quite the burden, especially if you factor in that the callback may happen on another server in the cluster. In my gist I used a Map, but that will obviously not work in a more complex environment.

Groeten,

Friso

Van: Pavel Bucek
Verzonden: donderdag 9 maart 2017 08:21
Aan: users_at_jax-rs-spec.java.net
Onderwerp: [jax-rs-spec users] Re: Server Sent Events

Hi Friso,
the example in JAX-RS and your case is the same.
We are using executor service to show that it IS possible to send/store SseEventSink instances and work with them from another Thread.
Having said that, your case is ok and will work as it does now. The only thing is (and I believe that is just a "typo" on your side) is that it must be different Thread, not a Process, as is mentioned in the code snippet you've presented.
Best regards,