mirror of
https://github.com/fluencelabs/redis
synced 2025-03-20 17:40:50 +00:00
23 lines
328 B
Ruby
23 lines
328 B
Ruby
require "redis"
|
|
|
|
class Redis
|
|
class Pipeline < Redis
|
|
BUFFER_SIZE = 50_000
|
|
|
|
def initialize(redis)
|
|
@redis = redis
|
|
@commands = []
|
|
end
|
|
|
|
def call_command(command)
|
|
@commands << command
|
|
end
|
|
|
|
def execute
|
|
@redis.call_command(@commands)
|
|
@commands.clear
|
|
end
|
|
|
|
end
|
|
end
|