You are here

function background_process_set_process in Background Process 6

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

Set background process

@global object $user Current logged in user

Parameters

$handle: Handle of background process

$callback: Function of background process

Return value

boolean TRUE if set, FALSE if not

2 calls to background_process_set_process()
BackgroundProcess::execute in ./BackgroundProcess.class.php
BackgroundProcess::queue in ./BackgroundProcess.class.php

File

./background_process.module, line 673

Code

function background_process_set_process($handle, $callback, $uid, $args, $token) {

  // Setup parameters
  $args = serialize($args);
  $callback = serialize($callback);

  // Get user
  if (!isset($uid)) {
    global $user;
    $uid = $user->uid;
  }
  db_query("UPDATE {background_process} SET callback = '%s', args = '%s', uid = %d, token = '%s' WHERE handle = '%s'", $callback, $args, $uid, $token, $handle);
  $result = db_affected_rows();
  return $result;
}