Newer Version Available

This content describes an older version of this product. View Latest

Queuing of Server-Side Actions

The framework queues up actions before sending them to the server. Actions are grouped together into batches, and then sent to the server together. This process enables the framework to reduce network traffic by batching multiple actions into fewer, more efficient requests.

The framework uses a stack to track the actions to send to the server. When the browser finishes processing events and JavaScript on the client, enqueued actions on the stack are sent to the server in a batch, or boxcar. Multiple actions sent in the same boxcar are processed in one transaction.

This mechanism is largely transparent to you when you’re writing code, as long as you follow a few simple guidelines. The most important thing to keep in mind is that actions and responses are asynchronous. Responses to actions can return in a different order than they were sent. If one action depends on the results of another, you must manage the sequence and timing of the actions in your code. See Batching of Server-side Actions for more details and guidelines.