You are here

function _background_process_queue in Background Process 7

Same name and namespace in other branches
  1. 8 background_process.module \_background_process_queue()
  2. 6 background_process.module \_background_process_queue()

Worker callback for processing queued function call.

1 string reference to '_background_process_queue'
background_process_cron_queue_info in ./background_process.module
Implements hook_cron_queue_info().

File

./background_process.module, line 333

Code

function _background_process_queue($item) {
  $oldhandle = background_process_current_handle();
  list($handle, $token) = $item;
  if (background_process_service_access($handle, $token)) {
    try {
      background_process_service_execute(rawurldecode($handle), TRUE);
      background_process_current_handle($oldhandle);
    } catch (Exception $e) {
      background_process_current_handle($oldhandle);
      background_process_update_status(rawurldecode($handle), BACKGROUND_PROCESS_STATUS_QUEUED);
      throw $e;
    }
  }
}