You are here

function background_process_service_group_random in Background Process 6

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

Load balancing based on random pick.

File

./background_process.module, line 262

Code

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