otm:ordering_of_messages:fifo

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

  • otm/ordering_of_messages/fifo.1294272763.txt.gz
  • Last modified: 2011/01/06 00:12
  • by aspectscript