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

modules/system/system.api.php, line 4872

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.