function callback_queue_worker

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

drupal/modules/system/system.api.php, line 4845
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);
}