ruby library client is not Redis-rb merged with RubyRedis "engine" by Brian McKinney

This commit is contained in:
antirez
2009-05-29 12:28:37 +02:00
parent d90b352ded
commit 69664139b5
8 changed files with 462 additions and 1068 deletions

View File

@ -8,19 +8,13 @@ class Redis
@redis = redis
@commands = []
end
def execute_command(data)
@commands << data
write_and_read if @commands.size >= BUFFER_SIZE
def call_command(command)
@commands << command
end
def finish
write_and_read
end
def write_and_read
@redis.execute_command(@commands.join, true)
@redis.read_socket
def execute
@redis.call_command(@commands)
@commands.clear
end