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
Last revision Both sides next revision
otm:ordering_of_messages:discard_early [2011/06/27 05:43]
aspectscript
otm:ordering_of_messages:discard_early [2012/02/06 18:49]
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 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.txt
  • Last modified: 2012/02/06 18:49
  • by aspectscript