I'm looking into adding clustered redis support to some of our applications and I'm currently hitting a bit of a snag.
Our current usage around RedisClient involves subclassing it so we can add instrumentation around our redis usage every time we run a command. We also do the same with pipelines, instead of using Pipeline directly we use a subclass of it that adds instrumentation.
Hi,
I'm looking into adding clustered redis support to some of our applications and I'm currently hitting a bit of a snag.
Our current usage around
RedisClient
involves subclassing it so we can add instrumentation around our redis usage every time we run a command. We also do the same with pipelines, instead of usingPipeline
directly we use a subclass of it that adds instrumentation.We're trying to apply the same logic here and it works well enough with
ClusterRedisClient
, but I just realised that therediscluster
package doesn't really exportClusterPipeline
, (https://github.com/Grokzen/redis-py-cluster/blob/73f27edf7ceb4a408b3008ef7d82dac570ab9c6a/rediscluster/__init__.py#L39-L54) so we can't really subclass it.We can just do
from rediscluster.pipeline import ClusterPipeline
but it seems cleaner if it's all exported from rediscluster directly.Is this an intentional design decision or could it just be added to support this use case? I'll get a PR ready just in case it's the latter 😄
Thanks!