Redis分布式锁对于基数排序的实现

huangapple go评论78阅读模式
英文:

Redis distributed locking for radix

问题

我正在使用https://github.com/mediocregopher/radix作为我的Redis客户端。之前在使用go-redis时,我使用了redislock来进行分布式锁定。在radix中是否有类似的包可用?

英文:

I am using https://github.com/mediocregopher/radix as my redis client. Previously with go-redis I used redislock for distributed locking. Are there any such package for radix too?

答案1

得分: 1

你可以使用SETNX来实现,实际上这就是RedisLock在底层使用的方式,你可以在这里查看如何实现:链接。希望对你有帮助。

英文:

you can doit using SETNX actually that is the way that redislock does it underneath, you can see how do it here. I hope this works for you

huangapple
  • 本文由 发表于 2022年6月7日 15:49:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/72527688.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定