1.20.x system.api.php callback_queue_worker($queue_item_data)

Work on a single queue item.

Callback for hook_queue_info().

Parameters

$queue_item_data: The data that was passed to BackdropQueue::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

backdrop_cron_run()

Related topics

File

modules/system/system.api.php, line 196
Hooks provided by Backdrop 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();
}