Introduction
What options we have to gather long processing data from the backend to send out to the UI?
Usually the followings:
- open frequent connections – polling
- keep an open connection – websocket
Server Sent Events
With Server Sent Events you’re able to send continuous updates from the server.
Imagine as a client subscription to a server for a stream.
Sometimes we don’t need a full bi-directional protocol (sending data back from client side), just a non-blocking data flow with the ability to process data row by row, while still receiving from the connection.
These are updates, time splitted data chunks from the server side to provide a fluent UI experience.