This is an old revision of the document!


Web applications typically update data from servers (eg. whether, time). Developers has to overcome the issue of using obsolete data due to a late response of a server. For example, consider a website that shows the current time of a certain country using two Ajax requests. If the response second request arrives before than the response the first ajax request arrive, the showed time will be incorrect. Using a customized strategy, named discardLate, of ordering that discard the obsolete response, we can avoid aforementioned problem.

var discardLate = function(jp) {
  if(!this.isLate(jp)){     //is obsolete this join point?
    jp.proceed();
    this.updateCr(jp); //notifies that join point was executed.
  }
}

The implementation follows: Toggle between the code and example

  • discard_late.1294268736.txt.gz
  • Last modified: 2011/01/05 23:05
  • by aspectscript