You are here

public function BackgroundProcess::execute in Background Process 6

Same name and namespace in other branches
  1. 8 background_process.class.php \BackgroundProcess::execute()
  2. 7.2 background_process.inc \BackgroundProcess::execute()
  3. 7 BackgroundProcess.class.php \BackgroundProcess::execute()
1 call to BackgroundProcess::execute()
BackgroundProcess::start in ./BackgroundProcess.class.php
Start background process

File

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

Class

BackgroundProcess
BackgroundProcess class.

Code

public function execute($callback, $args = array()) {
  $this->callback = $callback;
  if (!background_process_set_process($this->handle, $callback, $this->uid, $args, $this->token)) {

    // Could not update process
    return NULL;
  }
  module_invoke_all('background_process_pre_execute', $this->handle, $callback, $args, $this->token);

  // Initialize progress stats
  progress_remove_progress($this->handle);
  $this->connection = FALSE;
  $this
    ->determineServiceHost();
  return $this
    ->dispatch();
}