otm:ordering_of_messages:discard_early

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
otm:ordering_of_messages:discard_early [2011/06/27 05:43]
aspectscript
otm:ordering_of_messages:discard_early [2012/02/06 18:49] (current)
aspectscript
Line 16: Line 16:
 </html> </html>
  
-The DiscardEarly strategy is implemented as a TM advice, which is a JavaScript function, that is executed every time the response is retrieved+The Discard Early strategy is implemented as a piece of advice, which is a JavaScript function, that is executed every time a server response is received
  
 <code javascript> <code javascript>
Line 22: Line 22:
   if(!this.isEarly(jp)){        if(!this.isEarly(jp)){     
     jp.proceed();     jp.proceed();
-    this.updateCr(jp); //notifies that join point was executed.+     this.idServerRespExpected = request.idServerResp + 1; 
   }   }
 } }
 +
 +var discardEarlyCallback = function(callback) {
 +  return function(jp,env) {
 +    //invoke the discard Early strategy
 +
 +    var request = jp.target;
 +   //Is it discarded?
 +   if (this.idServerRespExpected < request.idServerResp)
 +     callback(jp,env) ;
 +  } 
 +};
 </code> </code>
  
 Go back [[otm/ordering_of_messages|the parent Web page.]]. Go back [[otm/ordering_of_messages|the parent Web page.]].
  • otm/ordering_of_messages/discard_early.1309164224.txt.gz
  • Last modified: 2011/06/27 05:43
  • by aspectscript