Class: MemCache::BufferedIO

Inherits:
Net::BufferedIO
  • Object
show all
Defined in:
lib/active_support/vendor/memcache-client-1.7.4/memcache.rb

Overview

:nodoc:

Constant Summary collapse

BUFSIZE =
1024 * 16

Instance Method Summary collapse

Instance Method Details

#getsObject



1062
1063
1064
# File 'lib/active_support/vendor/memcache-client-1.7.4/memcache.rb', line 1062

def gets
  readuntil("\n")
end

#rbuf_fillObject

An implementation similar to this is in trunk for 1.9. When it gets released, this method can be removed when using 1.9



1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
# File 'lib/active_support/vendor/memcache-client-1.7.4/memcache.rb', line 1045

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



1058
1059
1060
# File 'lib/active_support/vendor/memcache-client-1.7.4/memcache.rb', line 1058

def setsockopt *args
  @io.setsockopt *args
end