Disque\Connection\Node\Node::readPriorityFromHello PHP Метод

readPriorityFromHello() приватный Метод

Read out the node's own priority from a HELLO response
private readPriorityFromHello ( array $hello, string $id ) : integer
$hello array The HELLO response
$id string Node ID
Результат integer Node priority
    private function readPriorityFromHello($hello, $id)
    {
        foreach ($hello[HelloResponse::NODES] as $node) {
            if ($node[HelloResponse::NODE_ID] === $id) {
                return $node[HelloResponse::NODE_PRIORITY];
            }
        }
        // Node not found in the HELLO? This should not happen.
        // Return a fallback value
        return self::PRIORITY_FALLBACK;
    }