Class: MemCache::BufferedIO
- Inherits:
-
Net::BufferedIO
- Object
- Net::BufferedIO
- MemCache::BufferedIO
- Defined in:
- lib/memcache.rb
Overview
:nodoc:
Constant Summary collapse
- BUFSIZE =
1024 * 16
Instance Method Summary collapse
Instance Method Details
#encode(str) ⇒ Object
1159 1160 1161 |
# File 'lib/memcache.rb', line 1159 def encode(str) str.force_encoding(Encoding.default_external) end |
#gets ⇒ Object
1154 1155 1156 |
# File 'lib/memcache.rb', line 1154 def gets encode(readuntil("\n")) end |
#rbuf_fill ⇒ Object
1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 |
# File 'lib/memcache.rb', line 1136 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
1150 1151 1152 |
# File 'lib/memcache.rb', line 1150 def setsockopt(*args) @io.setsockopt(*args) end |