If I'm not sure when my client is going to reach out to the server, would I just send out the /stream-sse every once in a while? I thought sever sent events would allow me to just automatically send the event to the client. I guess I don't understand how to initialize each time
The client would reach out to the server just to initiate the connection. If that is not done, the server would not know the address of the client before hand.
So, SSE can be used only when server needs to push and no bidirectional communication is required, like push notification. SSE is quite lightweight. Long Polling is less efficient than SSE because it requires the creation of a new HTTP request for each piece of data, but it may be a good choice for applications that need to support older browsers or that need to work around network restrictions.
Great video Does anyone use Server-Sent Events in their projects? If yes, for which use cases? This video dives into the main building blocks of Server-Sent Events in Go. ua-cam.com/video/nvijc5J-JAQ/v-deo.html
Thanks for that lesson in 'go'!
i really like this kind of video. keep it up man !
We can feel the passion in your delivery, keep going with the awesome content.
Thanks!!
I just discovered your channel and your content is awesome. Hope you get more subscribers
Thanks!! I am hoping for the same 🤓
I watched the video aboit Discord and now this video. I subscribe, keep making good content !
Thankyou! ❤️
This channel is gold
Thanks!
❤
If I'm not sure when my client is going to reach out to the server, would I just send out the /stream-sse every once in a while?
I thought sever sent events would allow me to just automatically send the event to the client.
I guess I don't understand how to initialize each time
The client would reach out to the server just to initiate the connection. If that is not done, the server would not know the address of the client before hand.
When should I use SSE over a websocket ? Or long pulling?
So, SSE can be used only when server needs to push and no bidirectional communication is required, like push notification. SSE is quite lightweight.
Long Polling is less efficient than SSE because it requires the creation of a new HTTP request for each piece of data, but it may be a good choice for applications that need to support older browsers or that need to work around network restrictions.
this example is not beginners friendly, thanks.
Sorry for that.
Can you upload the code to github ?
Great video Does anyone use Server-Sent Events in their projects? If yes, for which use cases? This video dives into the main building blocks of Server-Sent Events in Go.
ua-cam.com/video/nvijc5J-JAQ/v-deo.html