Today I am going to tell you about multiple actions batching when you are working with multiple Lightning Components in an Application.
Most component based technologies allow independent components to maintain a communication channel with their back-end services unfortunately this can result in redundant messaging specially when it constrain by narrow band width on mobile devices.
Lightning Component Framework is design to optimize calls to Salesforce back-end. There could be many separate actions fired from multiple components in any application but all the actions are processed in a single batch this allow us for very efficient processing.
As actions are instantiated and configured they are enqued in a batch.The framework execute each action in the queue after batching up related request.
Now rather then sending separate request for each individual action a single call is made to the server with batch of asynchronous actions each containing the information they need and fire multiple apex processes.
As it is possible for certain actions to be fired more than once the framework also can ensure that only the most recent instance of any action will be batched for processing.
The related action methods are invoked and the framework than gathers and sends back a batch of results again in a single call invoking all related callback functions.
Hope this will be helpful 🙂