You are here

public function BackgroundProcess::start in Background Process 6

Same name and namespace in other branches
  1. 8 background_process.class.php \BackgroundProcess::start()
  2. 7.2 background_process.inc \BackgroundProcess::start()
  3. 7 BackgroundProcess.class.php \BackgroundProcess::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: Function to call.

$args: Array containg arguments to pass on to the callback.

Return value

mixed TRUE on success, NULL on failure, FALSE on handle locked.

File

./BackgroundProcess.class.php, line 79
Class for handling background processes.

Class

BackgroundProcess
BackgroundProcess class.

Code

public function start($callback, $args = array()) {
  if (!$this
    ->lock()) {
    return FALSE;
  }
  return $this
    ->execute($callback, $args);
}