tpeczek/Lib.AspNetCore.ServerSentEvents

[Question] SSE concurrency

Closed this issue · 3 comments

Hello!
I would like to know if SSE is thread safe or do I need to lock client connections when transmitting data.

My use case is TPL Dataflow pipeline which has 2 branched pipelines. They both end with a SSE message broadcast ActionBlock.
When I added the second SSE broadcast block, my SSE client seems to not receive all the messages, and sometimes it does not receive anything at all for more than 40 seconds.
I did not have the same issue when I had only one SSE broadcast block, but now that they are two (running concurrently) I have this issue.

Hi @georgy93 ,

In general, scenario like the one you are describing shouldn't be an issue - but it apparently is 😉.

On description alone it's hard to say if the issue is in the application code, library code or something in between. If you would be so kind to create a minimal repro which could be used for investigation, I would be happy to take a look at it.

Hi again!

I found the cause of my problem. My app is behind Fabio and Fabio has problems with SSE in its earlier versions. Updating the version of Fabio should fix my problem.

Happy to hear you got it solved!