9/1/2023 0 Comments Drupal queue apiSo the question as asked can't be answered for we would need to know what is the source you want to process. should use the queue API instead of executing the tasks directly. Like so: namespace Drupal\modulename\Plugin\QueueWorker Ĭlass XmlCreator extends QueueWorkerBase table with whatever serialized data is in the data column. These are the top rated real world PHP examples of Drupal::queue extracted from open. You should implement the function processItem($data) method.The contents should be a class XmlCreator extends QueueWorkerBase with a class annotation.If you have a hundred things to do in a day, you need to write them down and cross them off the list as you do them. The system tries to ensure that only one consumer can process an item. The queue system allows placing items in a queue and processing them later. Its very similar to the way we make to-do lists for household chores. Drupal 10.1 Queue operations Same name and namespace in other branches Queue items to allow later processing. The Queue API is designed to manage tasks. In the directory modulename/src/Plugin/QueueWorker directory create a file called XmlCreator.php One of the additions to Drupal 7 that went in without a lot of fanfare was the Queue API.You need to write your own QueueWorker plugin. In Drupal 9.5.1, you can get queues skipped by cron simply by not providing the cron section of the QueueWorker annotation. # Use this to only use Redis for a specific queue (aggregator_feeds in this case). # Or if you want to use reliable queue implementation. And don't forget to use the redis queue backend it's very helpful case you are using the Drupal queue API : # Use for all queues unless otherwise specified for a specific queue. So you can activate opcache and Redis cache to reduce the amount of code interpretation and interaction with Database. It's always a matter of the amount of treated data, algorithm and the machine memory and processor performance.Īlso it's very recommended if you have that kind of actions in your app to be very concerned about performance issues. The better solution that you implement a cron job for a chosen lapse of time that you are sure that you didn't have much traffic to run the build and the export of your xml file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |