You are here

function background_process_service_group_random in Background Process 7.2

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 background_process.module \background_process_service_group_random()

Load balancing based on random pick.

1 call to background_process_service_group_random()
background_process_ass_service_group_idle in background_process_ass/background_process_ass.module
Determine host with most idle workers and claim it.

File

./background_process.module, line 447

Code

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