function callback_queue_worker

callback_queue_worker($queue_item_data)

Work on a single queue item.

Callback for hook_cron_queue_info().

Parameters

$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 also

drupal_cron_run()

Related topics

File

modules/system/system.api.php, line 4829
Hooks provided by Drupal core and the System module.

Code

function callback_queue_worker($queue_item_data) {
  $node = node_load($queue_item_data);
  $node->title = 'Updated title';
  node_save($node);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!system!system.api.php/function/callback_queue_worker/7.x