X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/d7fc9edb182d361ac5c31b21fcdd25345c972898..43e5ccdf57e2144a8a43c04c5a64e91a155a78fb:/client-libraries/ruby/lib/pipeline.rb diff --git a/client-libraries/ruby/lib/pipeline.rb b/client-libraries/ruby/lib/pipeline.rb index f92b96db..acab5acc 100644 --- a/client-libraries/ruby/lib/pipeline.rb +++ b/client-libraries/ruby/lib/pipeline.rb @@ -8,19 +8,13 @@ class Redis @redis = redis @commands = [] end - - def execute_command(data) - @commands << data - write_and_read if @commands.size >= BUFFER_SIZE - end - - def finish - write_and_read + + def call_command(command) + @commands << command end - - def write_and_read - @redis.execute_command(@commands.join, true) - @redis.read_socket + + def execute + @redis.call_command(@commands) @commands.clear end