]>
Commit | Line | Data |
---|---|---|
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 | |
11 | ||
12 | def call_command(command) | |
13 | @commands << command | |
14 | end | |
15 | ||
16 | def execute | |
17 | @redis.call_command(@commands) | |
18 | @commands.clear | |
19 | end | |
20 | ||
21 | end | |
22 | end |