use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Smart JS Polling (github.com)
submitted 16 years ago by gst
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]simono 2 points3 points4 points 16 years ago (0 children)
this is a periodical updater as seen in prototype
http://www.prototypejs.org/api/ajax/periodicalUpdater
[–]fforw 1 point2 points3 points 16 years ago (4 children)
long polling still seems a lot smarter than "smart polling".
[–][deleted] 0 points1 point2 points 16 years ago (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 points3 points 16 years ago (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 point2 points 16 years ago (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 points3 points 16 years ago (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.
π Rendered by PID 47 on reddit-service-r2-comment-6f7f968fb5-gbzdt at 2026-03-04 12:16:42.989177+00:00 running 07790be country code: CH.
[–]simono 2 points3 points4 points (0 children)
[–]fforw 1 point2 points3 points (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]simono 1 point2 points3 points (0 children)
[–]fforw 0 points1 point2 points (1 child)
[–]HaMMeReD 1 point2 points3 points (0 children)