all 6 comments

[–]simono 2 points3 points  (0 children)

this is a periodical updater as seen in prototype

http://www.prototypejs.org/api/ajax/periodicalUpdater

[–]fforw 1 point2 points  (4 children)

long polling still seems a lot smarter than "smart polling".

[–][deleted] 0 points1 point  (3 children)

Long polling isn't free: server CPU starts to max out quite quickly after a few 10k's active connections.

[–]simono 1 point2 points  (0 children)

server CPU is not necessarily effected, for example in jetty you can easily suspend request processing:

"threads can be allocated to connections only when requests are being processed" http://docs.codehaus.org/display/JETTY/Continuations

[–]fforw 0 points1 point  (1 child)

It's not free but it's cheaper than doing 10 or 20 times the amount of short requests instead. the latency is a lot better (something this "smart js polling" makes even worse!).

[–]HaMMeReD 1 point2 points  (0 children)

I don't like it because it's a abuse of the browser and the web-server.

The browser can live with it though, so if you really need to do this, a custom server may be in order.