

Queue documentation is a bit short, without examples, but the basic idea is that you set enqueue tasks and those get processed during cron runs. by having a count from your external system) or use the $context variable to keep doing it until you no longer get any results. It has links to the batch and Queue API's on the frontpage.īatch is pretty complete, the main decision is between multiple operations (if you know which operations you need to make, e.g.
#Drupal queue api code#
If you found tutorials and tried it you should post the code you have and then you will get more specific help.ĭid you try the official API documentation:

I hope you and others with the same question understand the usage of the Queue API and Batch API with the help of this module.īatch in Drupal 7 and 8 works pretty much the same way. It will collect all of your queue items, creates batch operations from them, and after that it process one after another.

If you would like to process all the queue items in you browser, you have to visit the following url: Xml_import_example.get_contents_from_xml:ĭefaults: line, cron do nothing with your queue items. Xml_import_ # Get contents from the xml source Xml_import_ import content from xml:ĭescription: 'With this permission user can import contents from a XML source' I have made a lots of comment, so i think, it is easy to understand.ĭescription: "This module helps understanding the Batch API and Queue API with an XML import example" I show you here the files and its contents. I have made an example module to help understanding the Queue API and the Batch API.
