Class: Redis::Connection::UNIXSocket

Inherits:
Socket
  • Object
show all
Includes:
SocketMixin
Defined in:
lib/redis/connection/ruby.rb,
lib/redis/connection/ruby.rb

Constant Summary

Constants included from SocketMixin

SocketMixin::CRLF

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SocketMixin

#_write_to_socket, #gets, #initialize, #read, #timeout=, #write, #write_timeout=

Class Method Details

.connect(path, timeout) ⇒ Object



129
130
131
132
133
134
135
136
# File 'lib/redis/connection/ruby.rb', line 129

def self.connect(path, timeout)
  Timeout.timeout(timeout) do
    sock = new(path)
    sock
  end
rescue Timeout::Error
  raise TimeoutError
end

Instance Method Details

#_read_from_socket(nbytes) ⇒ Object

JRuby raises Errno::EAGAIN on #read_nonblock even when IO.select says it is readable (1.6.6, in both 1.8 and 1.9 mode). Use the blocking #readpartial method instead.



142
143
144
145
146
# File 'lib/redis/connection/ruby.rb', line 142

def _read_from_socket(nbytes)
  readpartial(nbytes)
rescue EOFError
  raise Errno::ECONNRESET
end