Seam Remoting allows multiple component calls to be executed within a single request. It is recommended that this feature is used wherever it is appropriate to reduce network traffic.
The method Seam.Remoting.startBatch()
will start a new batch, and 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 will send 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 containining all return values will be returned to the client and the callback functions (if provided) triggered in the same order as execution.
If you start a new batch via the startBatch()
method but then decide you don't want to send it, the Seam.Remoting.cancelBatch()
method will discard any calls that were queued and exit the batch mode.
To see an example of a batch being used, take a look at /examples/remoting/chatroom
.