You are here

public function BackgroundProcess::start in Background Process 7.2

Same name and namespace in other branches
  1. 8 background_process.class.php \BackgroundProcess::start()
  2. 6 BackgroundProcess.class.php \BackgroundProcess::start()
  3. 7 BackgroundProcess.class.php \BackgroundProcess::start()

File

./background_process.inc, line 761
External API short overview

Class

BackgroundProcess
@file

Code

public function start($callback, $args) {
  $process = BackgroundProcess::lock($this->handle);
  $process
    ->ensureCleanup(FALSE, FALSE);
  $this->handle = $process->handle;
  $this->token = $process->token;
  $this->exec_status = $process->exec_status;
  $this->created = $process->created;
  $this->pid = $process->pid;
  $this
    ->ensureCleanup(FALSE, TRUE);
  return $this
    ->setCallback($callback, $args)
    ->dispatch()
    ->getHandle();
}