You are here

function background_process_cron_queue_info in Background Process 7.2

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

Implements hook_cron_queue_info().

File

./background_process.module, line 238

Code

function background_process_cron_queue_info() {
  $default = variable_get('background_process_queue_name', BACKGROUND_PROCESS_QUEUE_NAME);
  $queues = array();
  $queues[$default] = array(
    'worker callback' => 'background_process_cron_queue_worker',
  );
  $service_hosts = background_process_get_service_hosts();
  foreach ($service_hosts as $service_host) {
    if ($service_host['dispatcher'] == 'queue' && isset($service_host['queue']) && !isset($queues[$service_host['queue']])) {
      $queues[$service_host['queue']] = $queues[$default];
    }
  }
  return $queues;
}