otm:ordering_of_messages

This is an old revision of the document!


Ordering of messages

Ajax technologies are a group of interrelated Web development methods used on the client-side to create interactive Web applications. With Ajax, Web applications can retrieve data from the server or other clients asynchronously in the background. As the figure below shows, a Web application sends requests to the network (eg. servers or other web applications) and later this Web application retrieves responses, which are processed by user defined functions, named callbacks.

 Ajax requests

Unsurprisingly, the responses can be retrieved in an arbitrary order, which not necessarily respect the order in which their associated requests are sent. This feature brings unexpected (and not easily controllable) results when these responses are processed in a particular order. To control unexpected results, OTM allows developers to define expressively which is the order of executions of responses. Next, we present three examples that show the use of different strategies of ordering.

  1. Fifo. The fifo strategy executes the responses in the same order which their associated requests are sent. This example illustrates how to define and use the fifo strategy to show create correctly a web page.
  2. Discard Late. The discard late strategy does not execute the responses that are retrieved late (eg. the first response is not executed or skipped if the second was already executed). This example illustrates how to define and use the discard late strategy to show correctly the flow of a streaming media.
  3. Discard Early. The discard early strategy does not execute the response that retrieved early (eg. the second response is not executed if the first has not executed yet). This example illustrates how to define and use the discard early strategy to show correctly the posts of a thread in a forum.

Go OTM home.

  • otm/ordering_of_messages.1294793618.txt.gz
  • Last modified: 2011/01/11 20:53
  • by aspectscript