System Design Patterns: From Fundamentals to Real Systems
Vote

0% completed

​

Server-Sent Events

retry: 5000 id: 8812-3 event: status data: {"order": "8812", "status": "packed"} : keep-alive id: 8812-4 event: status data: {"order": "8812", "status": "shipped"}

The text above is what the store's server writes to a buyer's browser while the buyer watches order 8812 on the tracking page. It is not a list of separate responses. It is one HTTP response that has not ended yet. The server wrote the "packed" block when the warehouse packed the order, wrote the "shipped" block later, and is now waiting to write the next one.

A blank line ends each block, and a block with a `data

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content