You are here

function background_process_get_processes in Background Process 6

Same name and namespace in other branches
  1. 8 background_process.module \background_process_get_processes()
  2. 7 background_process.module \background_process_get_processes()

Get background process

Parameters

$handle: Handle of background process

Return value

object Background process

2 calls to background_process_get_processes()
background_process_ass_auto_unlock in background_process_ass/background_process_ass.module
Unlock locked processes that aren't really running.
background_process_overview_page in ./background_process.admin.inc
Overview of background processes.

File

./background_process.module, line 740

Code

function background_process_get_processes($status = NULL) {
  if (isset($status)) {
    $result = db_query("SELECT handle, callback, args, uid, token, service_host, start_stamp, exec_status FROM {background_process} WHERE exec_status = %d", $status);
  }
  else {
    $result = db_query("SELECT handle, callback, args, uid, token, service_host, start_stamp, exec_status FROM {background_process}");
  }
  $processes = array();
  while ($process = db_fetch_object($result)) {
    $process->args = unserialize($process->args);
    $process->callback = unserialize($process->callback);
    $process->start = $process->start_stamp;
    $process->status = $process->exec_status;
    $processes[] = $process;
  }
  return $processes;
}