summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2015-05-04 22:29:01 -0400
committerDavid Rothstein <drothstein@gmail.com>2015-05-04 22:29:01 -0400
commitedf23f2041761ad55d3cd38057f757bc68acfa5a (patch)
tree539c95dc6b132d5bbfd037fa11b0179c4be7ec9d /modules
parent1a17a804581a92d4fec9e3b9bf8dc63eee404653 (diff)
downloadbrdo-edf23f2041761ad55d3cd38057f757bc68acfa5a.tar.gz
brdo-edf23f2041761ad55d3cd38057f757bc68acfa5a.tar.bz2
Issue #2208649 by areke, David_Rothstein, joachim, er.pushpinderrana, TravisCarden: Followup fixes to the documentation of the queue worker callback
Diffstat (limited to 'modules')
-rw-r--r--modules/system/system.api.php46
1 files changed, 23 insertions, 23 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php
index 164647b86..d6cbc7697 100644
--- a/modules/system/system.api.php
+++ b/modules/system/system.api.php
@@ -606,7 +606,7 @@ function hook_cron() {
* @return
* An associative array where the key is the queue name and the value is
* again an associative array. Possible keys are:
- * - 'worker callback': A PHP callable to call that is an implementation of
+ * - 'worker callback': The name of an implementation of
* callback_queue_worker().
* - 'time': (optional) How much time Drupal should spend on calling this
* worker in seconds. Defaults to 15.
@@ -644,28 +644,6 @@ function hook_cron_queue_info_alter(&$queues) {
}
/**
- * Work on a single queue item.
- *
- * Callback for hook_queue_info().
- *
- * @param $queue_item_data
- * The data that was passed to DrupalQueue::createItem() when the item was
- * queued.
- *
- * @throws \Exception
- * The worker callback may throw an exception to indicate there was a problem.
- * The cron process will log the exception, and leave the item in the queue to
- * be processed again later.
- *
- * @see drupal_cron_run()
- */
-function callback_queue_worker($queue_item_data) {
- $node = node_load($queue_item_data);
- $node->title = 'Updated title';
- $node->save();
-}
-
-/**
* Allows modules to declare their own Form API element types and specify their
* default values.
*
@@ -4813,6 +4791,28 @@ function hook_filetransfer_info_alter(&$filetransfer_info) {
*/
/**
+ * Work on a single queue item.
+ *
+ * Callback for hook_cron_queue_info().
+ *
+ * @param $queue_item_data
+ * The data that was passed to DrupalQueueInterface::createItem() when the
+ * item was queued.
+ *
+ * @throws Exception
+ * The worker callback may throw an exception to indicate there was a problem.
+ * The cron process will log the exception, and leave the item in the queue to
+ * be processed again later.
+ *
+ * @see drupal_cron_run()
+ */
+function callback_queue_worker($queue_item_data) {
+ $node = node_load($queue_item_data);
+ $node->title = 'Updated title';
+ node_save($node);
+}
+
+/**
* Return the URI for an entity.
*
* Callback for hook_entity_info().