- Issue created by @gbmapo
- 🇩🇪Germany simonbaese Berlin
@gbmapo Thanks for the question. Technically, this module does not use batches. It uses queues.
The feature you are asking for is the responsibility of the queue itself. However, the Symfony Mailer Queue module implements a queue worker independent of the actual queue implementation.
A queue worker only implements what should be done to process a single item. You can see this in the
Drupal\Core\Queue\QueueWorkerInterface::processItem()
method.In the default setup, you would process the database queue with a cron job. The relevant
processQueue()
method can be found inDrupal\Core\Cron
. Unfortunately, there is no option to limit the processed items here.You may consult the implementation in Drush for limiting the processed items. You can use the command
drush queue:run symfony_mailer_queue --limit=10
with the respective flag. The relevant code can be found inDrush\Commands\core\DrushCommands::run()
.This feature most likely will not make it into this module. However, this module offers the option to "rate limit" the email sending with the "Wait time per item" configuration option. Maybe that suits your concerns.
Other options may exist when using more advanced queues such as RabbitMQ.
Feel free to follow up with more questions.
- 🇫🇷France gbmapo
Would it be possible to run
drush queue:run symfony_mailer_queue --limit=10
with a cron job?
I use Ultimate Cron on my site.