sync with jodosha redis-rb

This commit is contained in:
antirez
2009-06-10 00:11:17 +02:00
parent 38210f7fe5
commit 0df1ead745
6 changed files with 461 additions and 664 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