From edf23f2041761ad55d3cd38057f757bc68acfa5a Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 4 May 2015 22:29:01 -0400 Subject: Issue #2208649 by areke, David_Rothstein, joachim, er.pushpinderrana, TravisCarden: Followup fixes to the documentation of the queue worker callback --- modules/system/system.api.php | 46 +++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'modules') 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. @@ -643,28 +643,6 @@ function hook_cron_queue_info_alter(&$queues) { $queues['aggregator_feeds']['time'] = 90; } -/** - * 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. @@ -4812,6 +4790,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. * -- cgit v1.2.3