Sha256: 36778cd896b2df572e1ff70fe387b9e9749bbc313bd4f847252b268587c6d5ac
Contents?: true
Size: 809 Bytes
Versions: 21
Compression:
Stored size: 809 Bytes
Contents
# frozen_string_literal: true require_relative '../../polyphony' require 'redis-client' class RedisClient class RubyConnection class BufferedIO def fill_buffer(strict, size = @chunk_size) remaining = size empty_buffer = @offset >= @buffer.bytesize loop do max_read = [remaining, @chunk_size].max bytes = if empty_buffer @io.readpartial(max_read, @buffer) else @io.readpartial(max_read) end raise Errno::ECONNRESET if bytes.nil? if empty_buffer @offset = 0 empty_buffer = false else @buffer << bytes end remaining -= bytes.bytesize return if !strict || remaining <= 0 end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems