POST-BETA: Import BatchingQueueListener changes from v1.2.2

After the beta we can commit this.

This implements a pre-fetching batch consumer for Impact's consumption. Impact is using this code since v4.2.5.