Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
otm:ordering_of_messages:fifo [2011/01/11 20:44] aspectscript |
otm:ordering_of_messages:fifo [2011/06/27 05:23] aspectscript |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | Every day, [[http://en.wikipedia.org/wiki/Mashup_%28web_application_hybrid%29|mashup]] applications are more present. These applications are created with requests to several servers. Developers | + | A mashup application is created from the combination of information retrieved from different servers, //e.g.// Housing Maps. Programmers |
- | When the " | + | When the " |
< | < | ||
Line 11: | Line 11: | ||
</ | </ | ||
- | The Fifo strategy is implemented as a TM advice, which a JavaScript function, that is executed every time a response is retrieved: | + | The FIFO strategy is implemented as a piece of advice, which is a JavaScript function, that is executed every time a server |
<code javascript> | <code javascript> | ||
- | var fifo = function(jp){ | + | var FIFO = function(jp){ |
- | if(this.isEarly(jp)){ | + | var request = jp . target ; |
- | this.queue.push(jp); | + | if (this.idServerRespExpected != request.idServerResp){ |
- | } | + | this.jpsQueue.push(jp) ; |
- | else{ | + | } |
- | jp.proceed(); | + | else{ |
- | this.updateCr(jp); | + | jp.proceed ( ) ; |
- | this.queue.executeEarlyJPs(); | + | this.idServerRespExpected = request.idServerResp + 1; |
- | } | + | // executing jp proceeds that can be executed now |
- | }; | + | this.idServerRespExpected =this.jpsQueue.execRecEarlyJPs( this . idServerRespExpected |
+ | } | ||
+ | } | ||
</ | </ | ||
Go back the [[otm/ | Go back the [[otm/ |