You are here

function background_process_get_service_groups in Background Process 7.2

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

Get service hosts defined in the system.

3 calls to background_process_get_service_groups()
BackgroundProcess::setServiceGroup in ./background_process.inc
Set the service group. This method sets the service host based on the service group.
background_batch_settings_form in background_batch/background_batch.admin.inc
System settings page.
background_process_settings_form in ./background_process.admin.inc
FAPI definition for settings page.

File

./background_process.module, line 607

Code

function background_process_get_service_groups() {
  $default_options = array(
    'method' => 'background_process_service_group_round_robin',
  );

  // Get defined service groups
  $service_groups = variable_get('background_process_service_groups', array());
  $service_groups += array(
    'default' => array(
      'hosts' => array(
        variable_get('background_process_default_service_host', 'default'),
      ),
    ),
  );

  // Populate service groups with default options
  foreach ($service_groups as &$service_group) {
    $service_group += $default_options;
  }
  return $service_groups;
}