]>
Commit | Line | Data |
---|---|---|
57172ffb | 1 | require "redis" |
2 | ||
3 | class Redis | |
4 | class Pipeline < Redis | |
5 | BUFFER_SIZE = 50_000 | |
6 | ||
7 | def initialize(redis) | |
8 | @redis = redis | |
9 | @commands = [] | |
10 | end | |
69664139 | 11 | |
12 | def call_command(command) | |
13 | @commands << command | |
57172ffb | 14 | end |
69664139 | 15 | |
16 | def execute | |
17 | @redis.call_command(@commands) | |
57172ffb | 18 | @commands.clear |
19 | end | |
20 | ||
21 | end | |
d7fc9edb | 22 | end |