Great, thanks for looking into this.
In addressing this issue, I think it's important not to impose stricter limitations on ajax requests than browsers naturally have. That would be crippling the Y!OS platform. In particular:
1) It's okay for a page to have multiple outstanding requests.
2) It's okay for ajax calls to complete and to update the page out of order.
What I'm suggesting in this thread is quite narrow. It's only when multiple <yml:a> and/or <yml:form> ajax calls are targeting the same element that there's a problem worth addressing.
Example 1
Suppose we have three links:
<yml:a href="a.html" insert="foo">A</yml:a>
<yml:a href="b.html" insert="foo">B</yml:a>
<yml:a href="c.html" insert="foo">C</yml:a>
If someone clicks all three quickly in the ordering (a, b, c), then it would be acceptable for the person to see the content displayed inside the "foo" element in any of these orderings, depending on which order the responses arrive:
(a,b,c)
(a,c)
(b,c)
©
but not in any ordering where b precedes a or c precedes a or b.
Example 2
Suppose we have a form:
<yml:form ... replace="bar">
<input type="text" name="baz" />
<input type="submit" />
</yml:form>
If someone submits the form three times with the text input containing "A", "B", and "C", in that order, then it would be acceptable to see the responses displayed in the same orderings that were acceptable in the first example, but unacceptable for the results of any submission to be displayed and then replaced by the result of an earlier submission. The same constraints should apply if there were multiple <yml:form> elements all targeting the same destination element ID.
Let me reemphasize that, in my opinion, these proposed ordering constraints should not apply globally across all <yml:a> and <yml:form> elements, since that would amount to crippling the platform (e.g. canceling legitimate requests or introducing artificial latency).