Hi Friso,
I'm not exactly sure what are you referring to - your code is quite
complex and it could use some cleanup; could you try to summarize your
concern into single code snippet (resource method/...)?
What do you mean by "I do not want to allocate a separate thread for
managing the SseEventSink"? I don't see anything in the API which would
say that you have to do that. SseEventSink instance is guaranteed to be
thread safe, so it can be stored and then used from different threads.
Best regards,
Pavel
On 08/03/2017 10:32, vrolijken_at_yahoo.com wrote:
>
> Hi,
>
> I read https://blogs.oracle.com/PavelBucek/entry/jax_rs_2_1_server
> which asked for comments here, so here goes:
>
> I’ve used SSE a couple of times now and I notice that my use case
> usually is different from what I see in most examples. The examples
> usually have an action that takes a lot of work to complete.
>
> My use case is normally that a request is started and it kicks off
> another process outside my application. The response sits there and
> waits for that process to complete. Some trigger, usually an incoming
> request, in my application will find the response and send an event
> when needed. So I do not want to allocate a separate thread for
> managing the SseEventSink. Rather I usually end up with something like
> this:
> https://github.com/digital-me/op-sdk-spi-impl/blob/master/src/main/java/nl/qiy/oic/op/qiy/ServerSentEventStreams.java
> . The downside of that is that it leaves me with warnings from the
> auto-closable.
>
> (If you’re interested, usage is on line 258 and 353 (which is called
> from the function starting on line 284) of
> https://github.com/digital-me/op-sdk-spi-impl/blob/master/src/main/java/nl/qiy/oic/op/qiy/QiyAuthorizationFlow.java)
>
>
> Is my use-case rare? Should I not be doing this with SSE?
>
> Groeten,
>
> Friso
>