SlightPHP\Rest_Http::addServer PHP Method

addServer() public static method

consistent hashing
public static addServer ( $host, $path = "", $weight = 1, $timeout = 1 )
    public static function addServer($host, $path = "", $weight = 1, $timeout = 1)
    {
        $weight = $weight * 10;
        for ($i = 1; $i <= $weight; $i++) {
            $serverid = self::hash($host . ":" . $path . ":" . $i);
            self::$_servers[] = array("host" => $host, "path" => $path, "weight" => $weight, "id" => $serverid, "timeout" => $timeout);
        }
        usort(self::$_servers, "self::_sort");
        self::$_serverCt = count(self::$_servers);
    }