3 ms·
Long polling works brilliantly (where your API call blocks until there are some results or until timeout occurs - then you loop and call again). Long polling g
by abraae 10y ago
Long polling works brilliantly (where your API call blocks until there are some results or until timeout occurs - then you loop and call again).
Long polling gives you the best of both worlds - easy programming model with instant alerting rather than the delay of normal polling.
The only downside really is the need for a more or less permanently open connection per client. As long as the server does not use a naive "thread per connection" model this can scale up to many hundreds of thousands of clients or more.
- Animats 10y agoThe good thing about long polling is that if the connection breaks, the keep-alive will time out and you'll know you're not getting updates. Assuming there's some keep-alive feature.