September 20, 2006 at 11:51 pm
· Filed under Metablogging, Writing, Plugs, William O'Neil
Riposte!
Miranda sits at the table and turns the ring over and over. “You should have called me,” she says.
“Of course I called you.” He blinks and frowns. “I called you until your mailbox filled up. I called out the window and I called 911. I called, I–I called you names–”
“Please don’t take that tone,” she says.
“Why not?” he asks coldly. “It’s not as if I can make you upset.”
But Miranda loves him, loves him like chocolate and heat and really good pop songs. She can’t speak. She slaps the table and all the windows blow out.
And it’s a bit of an in-joke, but William’s allegory for my occasional struggles with syndication is unfairly rich.
Permalink
Comments off
September 20, 2006 at 12:10 am
· Filed under Web Design
Dear my web developer friends: Hi. I’m building an AJAX application and I have some Javascript questions. Yes, if I were an earlier version of myself I’d stop reading now too.
The application is intended for use by small groups of people–say, two to ten–collaboratively, for a few hours at a time. There may be many small groups working simultaneously, but activity won’t overlap among groups, only among members of a given group.
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’s or Mallory’s parts except having the application page open.
I’m building this with Javascript and PHP/MySQL, no Java applets or anything. Is there any way to accomplish what I want that doesn’t involve polling–that is, using setTimeOut(XMLHttpRequest(…)) to refresh the activity panels every five seconds? setTimeOut is nonblocking on the client side, but that’s a huge number of requests per time period and it scales horribly.
I’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’t have to hit PHP and MySQL with every request). Like most optimizations, though, they don’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’t think there is, but I’m hoping I’m wrong.
Permalink
Comments off