Class: Redis2::Connection::UNIXSocket

Inherits:
Socket
  • Object
show all
Includes:
SocketMixin
Defined in:
lib/redis2/connection/ruby.rb,
lib/redis2/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=

Class Method Details

.connect(path, timeout) ⇒ Object



88
89
90
91
92
93
94
95
# File 'lib/redis2/connection/ruby.rb', line 88

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.



101
102
103
104
105
106
# File 'lib/redis2/connection/ruby.rb', line 101

def _read_from_socket(nbytes)
  readpartial(nbytes)

rescue EOFError
  raise Errno::ECONNRESET
end