Real Time Updates medium
In a Long Polling lifecycle, what happens immediately after the server returns data to the client?
- A The connection stays open for the next message.
- B The server waits for an ACK.
- C The client waits for a user action.
- D The connection closes, and the client logic immediately issues a new request to re-establish the listen state.
Answer: D. The connection closes, and the client logic immediately issues a new request to re-establish the listen state.
Long Polling is just a sequence of HTTP requests. Request -> Wait -> Response -> Close -> Immediate New Request. It simulates a stream but is technically a series of distinct connections.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- When a mobile app is closed/backgrounded, it cannot keep a WebSocket open. How does it receive real-time alerts (like 'New Message')?
- For a human user, what is generally considered the maximum acceptable latency for an interaction to feel 'Real-Time' (e.g., typing in a Google Doc)?
- If you want to update a news feed on a website every time a new article is published, what is the simplest (but least efficient) 'Real-Time' technique?
- In a persistent real-time connection, what is the purpose of a 'Heartbeat' or 'Ping/Pong' message?
- Why is Short Polling considered 'Chatty'?
- Server-Sent Events (SSE) are ideal for which type of real-time application?