{"id":90,"date":"2006-09-20T00:10:16","date_gmt":"2006-09-20T05:10:16","guid":{"rendered":"http:\/\/www.xorph.com\/creator\/2006\/09\/20\/canonical-first-public-mention-of-dogpool\/"},"modified":"2006-09-20T00:10:16","modified_gmt":"2006-09-20T05:10:16","slug":"canonical-first-public-mention-of-dogpool","status":"publish","type":"post","link":"https:\/\/www.xorph.com\/nfd\/2006\/09\/20\/canonical-first-public-mention-of-dogpool\/","title":{"rendered":"Canonical first public mention of Dogpool"},"content":{"rendered":"<p>Dear my web developer friends:  Hi.  I&#8217;m building an AJAX application and I have some Javascript questions.  Yes, if I were an earlier version of myself I&#8217;d stop reading now too.<\/p>\n<p>The application is intended for use by small groups of people&#8211;say, two to ten&#8211;collaboratively, for a few hours at a time.  There may be many small groups working simultaneously, but activity won&#8217;t overlap among groups, only among members of a given group.<\/p>\n<p>Say Alice, Esha and Mallory are using the application, which means having the page open in a tab or window.  Each of them has a panel on that page showing what the other two are up to.  Alice has five heads-up tokens, and she flips two of them over; I want Esha and Mallory to see that her tokens now consist of three heads and two tails within a few seconds of her doing so.  This should not require any activity on Esha&#8217;s or Mallory&#8217;s parts except having the application page open.<\/p>\n<p>I&#8217;m building this with Javascript and PHP\/MySQL, no Java applets or anything.  Is there any way to accomplish what I want that doesn&#8217;t involve polling&#8211;that is, using setTimeOut(XMLHttpRequest(&#8230;)) to refresh the activity panels every five seconds?  setTimeOut is nonblocking on the client side, but that&#8217;s a huge number of requests per time period and it scales horribly.<\/p>\n<p>I&#8217;m considering the obvious optimizations (having the client side taper off in request frequency during periods of inactivity, and writing the activity data to static files so I don&#8217;t have to hit PHP and MySQL with every request).  Like most optimizations, though, they don&#8217;t address the central problem of nonscalable methodology.  Is there anything in Javascript that would let the client accept pings from the server side when the data updates?  I don&#8217;t think there is, but I&#8217;m hoping I&#8217;m wrong.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dear my web developer friends: Hi. I&#8217;m building an AJAX application and I have some Javascript questions. Yes, if I were an earlier version of myself I&#8217;d stop reading now too. The application is intended for use by small groups of people&#8211;say, two to ten&#8211;collaboratively, for a few hours at a time. There may be [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-90","post","type-post","status-publish","format-standard","hentry","category-web-design"],"_links":{"self":[{"href":"https:\/\/www.xorph.com\/nfd\/wp-json\/wp\/v2\/posts\/90","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xorph.com\/nfd\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xorph.com\/nfd\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xorph.com\/nfd\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xorph.com\/nfd\/wp-json\/wp\/v2\/comments?post=90"}],"version-history":[{"count":0,"href":"https:\/\/www.xorph.com\/nfd\/wp-json\/wp\/v2\/posts\/90\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.xorph.com\/nfd\/wp-json\/wp\/v2\/media?parent=90"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xorph.com\/nfd\/wp-json\/wp\/v2\/categories?post=90"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xorph.com\/nfd\/wp-json\/wp\/v2\/tags?post=90"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}