1
1
import six
2
2
import redis
3
3
from redis import Redis , RedisError
4
+ from redis .client import Pipeline
4
5
from redis .client import bool_ok
5
6
from redis ._compat import (long , nativestr )
6
7
from redis .exceptions import DataError
@@ -192,7 +193,6 @@ def appendBucketSize(params, bucket_size):
192
193
params .extend (['BUCKETSIZE' , bucket_size ])
193
194
194
195
################## Bloom Filter Functions ######################
195
-
196
196
def bfCreate (self , key , errorRate , capacity , expansion = None , noScale = None ):
197
197
"""
198
198
Creates a new Bloom Filter ``key`` with desired probability of false
@@ -502,3 +502,21 @@ def topkInfo(self, key):
502
502
503
503
return self .execute_command (self .TOPK_INFO , key )
504
504
505
+ def pipeline (self , transaction = True , shard_hint = None ):
506
+ """
507
+ Return a new pipeline object that can queue multiple commands for
508
+ later execution. ``transaction`` indicates whether all commands
509
+ should be executed atomically. Apart from making a group of operations
510
+ atomic, pipelines are useful for reducing the back-and-forth overhead
511
+ between the client and server.
512
+ Overridden in order to provide the right client through the pipeline.
513
+ """
514
+ p = Pipeline (
515
+ connection_pool = self .connection_pool ,
516
+ response_callbacks = self .response_callbacks ,
517
+ transaction = transaction ,
518
+ shard_hint = shard_hint )
519
+ return p
520
+
521
+ class Pipeline (Pipeline , Client ):
522
+ "Pipeline for RedisBloom Client"
0 commit comments