Class: Redis::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/daikon/redis_hacks.rb

Instance Method Summary collapse

Instance Method Details

#call_loop_with_old_protocol(*args) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/daikon/redis_hacks.rb', line 16

def call_loop_with_old_protocol(*args)
  without_socket_timeout do
    process(args) do
      loop { yield(read_with_old_protocol) }
    end
  end
end

#read_with_old_protocolObject



24
25
26
27
28
29
30
31
32
33
# File 'lib/daikon/redis_hacks.rb', line 24

def read_with_old_protocol
  begin
    connection.read_with_old_protocol
  rescue Errno::EAGAIN
    disconnect
    raise Errno::EAGAIN, "Timeout reading from the socket"
  rescue Errno::ECONNRESET
    raise Errno::ECONNRESET, "Connection lost"
  end
end