Replies: 2 comments 36 replies
-
@manson Hi bro, |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
@manson Hi bro, |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Hi!
I'm here with another issue. I've been playing lately with SSE and used you example:
EventSource's response has a MIME type ("text/plain") that is not "text/event-stream". Aborting the connection.
. This is if no logs exist. But if I put c.Stream("") in the end it will work ok and data will come to client, but if no data, it will send to client empty strings. This is not good. Wrong. Stream should result to client only when I want, when data exists, but not periodically. I.e. It's ok to periodically call a handler, but only I should decide whether to send back data or not in it.Theoretically I could workaround this like in WS example - storing connection of caller and later send to stream, but in this case I cannot off this periodical handler calls. Besides, I suppose, you are already storing these connections to process periodic handler and additional copy I could do is not good.
So I think there needs to be made next changes:
Without this It looks like SSE not much useful...
Beta Was this translation helpful? Give feedback.
All reactions