Predis\Connection\Replication\SentinelReplication::querySentinelForSlaves PHP Метод

querySentinelForSlaves() защищенный Метод

Fetches the details for the slave servers from a sentinel.
protected querySentinelForSlaves ( Predis\Connection\NodeConnectionInterface $sentinel, string $service ) : array
$sentinel Predis\Connection\NodeConnectionInterface Connection to a sentinel server.
$service string Name of the service.
Результат array
    protected function querySentinelForSlaves(NodeConnectionInterface $sentinel, $service)
    {
        $slaves = array();
        $payload = $sentinel->executeCommand(RawCommand::create('SENTINEL', 'slaves', $service));
        if ($payload instanceof ErrorResponseInterface) {
            $this->handleSentinelErrorResponse($sentinel, $payload);
        }
        foreach ($payload as $slave) {
            $flags = explode(',', $slave[9]);
            if (array_intersect($flags, array('s_down', 'o_down', 'disconnected'))) {
                continue;
            }
            $slaves[] = array('host' => $slave[3], 'port' => $slave[5], 'role' => 'slave');
        }
        return $slaves;
    }