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_early [2011/06/27 08:43] aspectscript |
otm:ordering_of_messages:discard_early [2012/02/06 22:49] (current) aspectscript |
||
|---|---|---|---|
| Line 16: | Line 16: | ||
| </ | </ | ||
| - | The DiscardEarly | + | The Discard Early strategy is implemented as a piece of advice, which is a JavaScript function, that is executed every time a server |
| <code javascript> | <code javascript> | ||
| Line 22: | Line 22: | ||
| if(!this.isEarly(jp)){ | if(!this.isEarly(jp)){ | ||
| jp.proceed(); | jp.proceed(); | ||
| - | | + | this.idServerRespExpected = request.idServerResp + 1; |
| } | } | ||
| } | } | ||
| + | |||
| + | var discardEarlyCallback = function(callback) { | ||
| + | return function(jp, | ||
| + | //invoke the discard Early strategy | ||
| + | |||
| + | var request = jp.target; | ||
| + | //Is it discarded? | ||
| + | if (this.idServerRespExpected < request.idServerResp) | ||
| + | | ||
| + | } | ||
| + | }; | ||
| </ | </ | ||
| Go back [[otm/ | Go back [[otm/ | ||