redict/client-libraries/ruby/lib/pipeline.rb

23 lines
328 B
Ruby
Raw Normal View History

require "redis"
class Redis
class Pipeline < Redis
BUFFER_SIZE = 50_000
def initialize(redis)
@redis = redis
@commands = []
end
2009-06-09 18:11:17 -04:00
def call_command(command)
@commands << command
2009-06-09 18:08:10 -04:00
end
2009-06-09 18:11:17 -04:00
def execute
@redis.call_command(@commands)
@commands.clear
end
end
2009-05-26 12:10:50 -04:00
end