public function toPrioritizedArray()
    {
        // Reset the available managers every $this->unavailableCheckAt requests.
        if (($this->resetCounter % $this->resetAt) == 0) {
            $this->resetAvailableManagers();
        }
        $this->resetCounter++;

        $available =& $this->managerStatus[self::FLAG_AVAILABLE];
        $unavailable =& $this->managerStatus[self::FLAG_UNAVAILABLE];

        // Shuffle the available managers to distribute load.
        shuffle($available);

        // Add the unavailable managers at the end.
        $managerList = array_merge($available, $unavailable);

        return $managerList;
    }
public function toPrioritizedArray()
    {
        // Reset the available managers every $this->unavailableCheckAt requests.
        if (($this->resetCounter % $this->resetAt) == 0) {
            $this->resetAvailableManagers();
        }
        $this->resetCounter++;

        $available =& $this->managerStatus[self::FLAG_AVAILABLE];
        $unavailable =& $this->managerStatus[self::FLAG_UNAVAILABLE];

        // Shuffle the available managers to distribute load.
        shuffle($available);

        // Add the unavailable managers at the end.
        $managerList = array_merge($available, $unavailable);

        return $managerList;
    }
public function toPrioritizedArray ( ) { // Reset the available managers every $this->unavailableCheckAt requests. if ( ( $ this -> resetCounter % $ this -> resetAt ) == 0 ) { $ this -> resetAvailableManagers ( ) ; } $ this -> resetCounter ++ ; $ available = & $ this -> managerStatus [ self :: FLAG_AVAILABLE ] ; $ unavailable = & $ this -> managerStatus [ self :: FLAG_UNAVAILABLE ] ; // Shuffle the available managers to distribute load. shuffle ( $ available ) ; // Add the unavailable managers at the end. $ managerList = array_merge ( $ available , $ unavailable ) ; return $ managerList ; }
Returns an array or manager dsns, sorted by priority.

Available managers get priority over unavailable managers.
Once every x calls all managers will be flagged as available.

This makes sure managers that where unavailable for a period of
time will receive jobs once they get up.

@return array[]
Returns an array or manager dsns sorted by priority .