mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-24 00:59:02 -05: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
|