def read(nbytes, timeout = @timeout)
      result = @buffer.slice!(0, nbytes)

      while result.bytesize < nbytes
        result << readpartial(nbytes - result.bytesize, timeout)
      end

      result
    end
def read(nbytes, timeout = @timeout)
      result = @buffer.slice!(0, nbytes)

      while result.bytesize < nbytes
        result << readpartial(nbytes - result.bytesize, timeout)
      end

      result
    end
Maintain socket

 @param [Hash] opts Connection options

 @option opts [Float] :timeout (1.0) socket read/write timeout

 @option opts [String] :host ('localhost') Hostname or IP address to connect to
 @option opts [Integer] :port (6379) Port Redis server listens on
 @option opts [Float] :connect_timeout (1.0) socket connect timeout

 @option opts [String] :path UNIX socket path
 Read number of bytes
 @param [Integer] nbytes number of bytes to read
 @return [String] read result