You are here

function background_process_service_start in Background Process 8

Same name and namespace in other branches
  1. 6 background_process.module \background_process_service_start()
  2. 7.2 background_process.module \background_process_service_start()
  3. 7 background_process.module \background_process_service_start()

Implements to Call the function requested by the service call.

File

./background_process.module, line 391
This module implements a framework for calling funtions in the background.

Code

function background_process_service_start($handle, $return = FALSE) {
  header('Content-Type', 'text/plain');

  // Let's clean up the mess the menu-router system leaves behind.
  $cid = 'menu_item:' . hash('sha256', $_GET['q']);
  drupal_register_shutdown_function('_background_process_cleanup_menu', $cid);

  // Setup service.
  ignore_user_abort(TRUE);
  @set_time_limit(\Drupal::config('background_process.settings')
    ->get('background_process_service_timeout'));
  $handle = rawurldecode($handle);
  return background_process_service_execute($handle, $return);
}