public function BackgroundProcess::execute in Background Process 7
Same name and namespace in other branches
- 8 background_process.class.php \BackgroundProcess::execute()
- 6 BackgroundProcess.class.php \BackgroundProcess::execute()
- 7.2 background_process.inc \BackgroundProcess::execute()
1 call to BackgroundProcess::execute()
- BackgroundProcess::start in ./BackgroundProcess.class.php
- Start background process
File
- ./BackgroundProcess.class.php, line 162
- Class for handling background processes.
Class
- BackgroundProcess
- BackgroundProcess class.
Code
public function execute($callback, $args = array()) {
$this->callback = $callback;
$this->args = $args;
if (!background_process_set_process($this->handle, $this->callback, $this->uid, $this->args, $this->token)) {
return NULL;
}
module_invoke_all('background_process_pre_execute', $this->handle, $this->callback, $this->args, $this->token);
$old_db = db_set_active('background_process');
progress_remove_progress($this->handle);
db_set_active($old_db);
$this->connection = FALSE;
$this
->determineServiceHost();
return $this
->dispatch();
}