You are here

function background_process_service_group_random in Background Process 7

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

Load balancing based on random pick.

File

./background_process.module, line 229

Code

function background_process_service_group_random($service_group) {
  return $service_group['hosts'][rand(0, count($service_group['hosts']) - 1)];
}