bsm / redislock

Simplified distributed locking implementation using Redis
Other
1.45k stars 157 forks source link

[Proposal] Allow redislock to compatible with multi versions of go-redis #77

Open git-hulk opened 7 months ago

git-hulk commented 7 months ago

Currently, redislock only depends on the Redis EVAL/EVALSHA command but directly introduces the go-redis/v9 scripter as the RedisClient interface. And make it incompatible with other versions of the Redis client like go-redis/v8.

I think we can avoid binding to any versions by moving the scripter outside the go-redis.

I will be happy to support this if it sounds good to you.

related issue: https://github.com/bsm/redislock/issues/48

dim commented 7 months ago

Sounds good in principle, but I am not sure how this would work in practice. Do you mind a PR?

git-hulk commented 7 months ago

@dim Sure, thank you! I will submit a PR for this.

harryeti commented 7 months ago

@git-hulk I have the same requirement and need to connect to two different versions of redis at the same time. Looking forward to your PR. :)