Re:AJAX best practices?
by jey on Friday July 27, 2007 @03:38PM
(#37159)
What's the specific problem? Why do you need the results to be ordered? If you really do need to order the results, just attach a sequential ID to each request, then hold a priority queue of results sorted by request ID. Pseudo-code follows:
The above code isn't very robust as it doesn't deal with requests that die in transit and never return a response, etc.
[ Parent
| on HN ]
Right - this is what I'm about to try to implement (and I think I'd trash the entire queue if a response isn't returned within some timeout limit and display a subsequent error message). I don't know if this is the best practice though and as this seems like a pretty generic AJAX problem, it feels like there should be a pretty generic solution...