Queue API topic and hook_queue_info() don't link to one another

Created on 12 May 2014, over 11 years ago
Updated 2 April 2023, over 2 years ago

Problem/Motivation

We have a Queue topic in Drupal 8:
https://api.drupal.org/api/drupal/core%21core.api.php/group/queue/8.4.x
(if this link is broken, go to Topics in the sidebar and find the Queue topic).

It currently says nothing about how to get a queue to be processed automatically in Cron.

Also, the plugin annotation class and hook related to this (QueueWorker annotation class and hook_queue_info_alter() ) are not listed as @ingroup for this topic, so they do not show up in the Functions and Classes lists on the topic page.

Proposed resolution

a) Add a section to the Queue topic about how to make a queue processed automatically in Cron. The main points:
- A queue can be set up to be processed in Cron by defining a QueueWorker plugin.
- This plugin needs to have \Drupal\Core\Annotation\QueueWorker annotation on it
- See the docs for that annotation class for details.

b) Make sure that the QueueWorker annotation class, Drupal\Core\Queue\QueueWorkerInterface, Drupal\Core\Queue\QueueWorkerBase and hook_queue_info_alter() both have lines in their doc blocks saying:
@ingroup queue

c) Make the Queue topic and hook_cron() have @see references to each other:
@see queue [in the hook]
@see hook_cron() [in the Queue topic]

Remaining tasks

Make a patch.

User interface changes

None.

API changes

None.

Beta eval

This is just API docs, so is unfrozen in Beta.

๐Ÿ› Bug report
Status

Fixed

Version

9.5

Component
Documentationย  โ†’

Last updated 18 days ago

No maintainer
Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom joachim

Live updates comments and jobs are added and updated live.
  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024