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

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

Class Method Details

.connect(path, timeout) ⇒ Object



123
124
125
126
127
128
129
130
# File 'lib/redis/connection/ruby.rb', line 123

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 it says it is readable (1.6.6, in both 1.8 and 1.9 mode). Use the blocking #readpartial method instead.



136
137
138
139
140
# File 'lib/redis/connection/ruby.rb', line 136

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