This module allows Drupal to use Symfony Messenger to process batch operations, grouping messages and providing a user interface to track their progress. It can replace the built-in Drupal Batch API, improving performance through parallel processing and allowing resources to be managed more efficiently.
Batch Messenger is divided into three pieces of functionality:
- Group Symfony Messenger messages together into a collection. (Base functionality).
Simply add aCollectionItemstamp with a shared ID. - Expose a UI of progress of each collection. (Optional, enabled by default)
- Intercept Drupal Batch API calls (
batch_set()) and replace with Messenger internals. (Optional, enabled by default)
This allows you to adopt Symfony Messenger, while providing a nice UI for the user. Performance of operations improve dramatically, as they may be worked in parallel, instead of single threaded. Message resources (CPU/memory, etc) can be increased in a worker, while granting the possibility to reduce web thread resources since they don't need to scale up for Batch API operations.
When the legacy Batch API is used (\batch_set), the UI is retained, and we provide status updates to the user despite operations not actually running in the web requests.
The module is a drop-in replacement for Batch API. If you encounter issues, uninstalling the module will return existing behavior. Though, any in-progress batches will be deleted.