24.6. Batch Requests
Seam Remoting lets you execute multiple component calls with a single request. We recommend using this feature when you need to reduce network traffic.
The
Seam.Remoting.startBatch()
method starts a new batch. Any component calls executed after starting a batch are queued, rather than being sent immediately. When all the desired component calls have been added to the batch, the Seam.Remoting.executeBatch()
method sends a single request containing all of the queued calls to the server, where they will be executed in order. After the calls have been executed, a single response containing all return values is returned to the client, and the callback functions are triggered in their execution order.
If you begin a batch, and then decide you do not want to send it, the
Seam.Remoting.cancelBatch()
method discards any queued calls and exits the batch mode.
For an example of batch use, see
/examples/remoting/chatroom
.