Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
otm:ordering_of_messages:discard_late [2011/06/27 08:30] aspectscript |
otm:ordering_of_messages:discard_late [2011/06/27 08:34] (current) aspectscript |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | Web applications typically update data from servers (//eg.// whether, time, streaming media, dollar rates, thread posts). Developers have to overcome the issue of using obsolete data due to a late response of a server. For example, consider a website that shows an [[http:// | + | ====== The Discard Late Strategy ====== |
+ | |||
+ | Web applications typically update data from servers (//eg.// whether, time, streaming media, dollar rates, thread posts). Developers have to overcome the issue of using obsolete data due to a late response of a server. For example, consider a website that shows an [[http:// | ||
When the " | When the " | ||
Line 12: | Line 14: | ||
</ | </ | ||
- | The Discard Late strategy is implemented as a piece of advice, which is a JavaScript function, that is executed every time a server response from //http:// | + | The Discard Late strategy is implemented as a piece of advice, which is a JavaScript function, that is executed every time a server response from // |
<code javascript> | <code javascript> | ||
Line 18: | Line 20: | ||
var request = jp.target ; | var request = jp.target ; | ||
if (this.idServerRespExpected <= request.idServerResp) { | if (this.idServerRespExpected <= request.idServerResp) { | ||
- | jp.proceed() ; | + | jp.proceed(); |
this.idServerRespExpected = request.idServerResp + 1; | this.idServerRespExpected = request.idServerResp + 1; | ||
} | } | ||
Line 25: | Line 27: | ||
WeCa.deployStrategy (discardLate, | WeCa.deployStrategy (discardLate, | ||
var request = jp.target ; | var request = jp.target ; | ||
- | return request.url == ”http://news.com” ; | + | return request.url == ”http://getstreamingvideo.com” ; |
}); | }); | ||
</ | </ | ||
- | Go back the [[otm/ | + | Go back the [[otm/ |