Class: MemCache::BufferedIO

Inherits:
Net::BufferedIO
  • Object
show all
Defined in:
lib/memcache.rb

Overview

:nodoc:

Constant Summary collapse

BUFSIZE =
1024 * 16

Instance Method Summary collapse

Instance Method Details

#getsObject



1066
1067
1068
# File 'lib/memcache.rb', line 1066

def gets
  readuntil("\n")
end

#rbuf_fillObject



1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
# File 'lib/memcache.rb', line 1048

def rbuf_fill
  begin
    @rbuf << @io.read_nonblock(BUFSIZE)
  rescue Errno::EWOULDBLOCK
    retry unless @read_timeout
    if IO.select([@io], nil, nil, @read_timeout)
      retry
    else
      raise Timeout::Error, 'IO timeout'
    end
  end
end

#setsockopt(*args) ⇒ Object



1062
1063
1064
# File 'lib/memcache.rb', line 1062

def setsockopt *args
  @io.setsockopt *args
end