Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

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.