class Redis::Client
def call_loop(*args)
Starting with 2.2.1, assume that this method is called with a single
def call_loop(*args) if args.first.is_a?(Array) && args.size == 1 command = args.first else command = args end error = nil result = without_socket_timeout do process([command]) do loop do reply = read if reply.is_a?(RuntimeError) error = reply break else yield reply end end end end # Raise error when previous block broke out of the loop. raise error if error # Result is set to the value that the provided block used to break. result end