You are here

function background_process_keepalive in Background Process 8

Same name and namespace in other branches
  1. 6 background_process.module \background_process_keepalive()
  2. 7.2 background_process.module \background_process_keepalive()
  3. 7 background_process.module \background_process_keepalive()

Implements to Keep process alive.

1 call to background_process_keepalive()
_background_batch_process in background_batch/background_batch.module
Implements to Process a batch step.
1 string reference to 'background_process_keepalive'
background_process_restart in ./background_process.module
Implements to Restart the current background process.

File

./background_process.module, line 517
This module implements a framework for calling funtions in the background.

Code

function background_process_keepalive() {
  $args = func_get_args();
  $handle = background_process_current_handle();
  if (!$handle) {
    throw new Exception(t('Background process handle %handle not found', [
      '%handle' => $handle,
    ]));
  }
  $process = background_process_get_process($handle);
  if (!$process) {
    throw new Exception(t('Background process %handle not found', [
      '%handle' => $handle,
    ]));
  }
  drupal_register_shutdown_function('_background_process_restart', $process, $args);
}