Predis\Connection\PhpiredisStreamConnection::read PHP Метод

read() публичный Метод

public read ( )
    public function read()
    {
        $socket = $this->getResource();
        $reader = $this->reader;
        while (PHPIREDIS_READER_STATE_INCOMPLETE === ($state = phpiredis_reader_get_state($reader))) {
            $buffer = stream_socket_recvfrom($socket, 4096);
            if ($buffer === false || $buffer === '') {
                $this->onConnectionError('Error while reading bytes from the server.');
            }
            phpiredis_reader_feed($reader, $buffer);
        }
        if ($state === PHPIREDIS_READER_STATE_COMPLETE) {
            return phpiredis_reader_get_reply($reader);
        } else {
            $this->onProtocolError(phpiredis_reader_get_error($reader));
            return;
        }
    }