You are here

function background_process_start in Background Process 7

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

Start background process.

Calls the service handler through http passing function arguments as serialized data. Be aware that the callback will run in a new request.

@global string $base_url Base URL for this Drupal request

Parameters

callback $callback: Function to call

mixed $var [, $... ]]: Arbitrary number of variables to pass on to the callback

Return value

mixed Handle on success, FALSE on failure

1 call to background_process_start()
background_batch_process_batch in background_batch/background_batch.module
Processes the batch.

File

./background_process.module, line 398

Code

function background_process_start($callback) {
  $process = new BackgroundProcess();
  $args = func_get_args();
  array_splice($args, 0, 1);
  $result = $process
    ->start($callback, $args);
  return $result ? $process->handle : $result;
}