Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我想在 Redisson 中设置一个存储桶,我是否需要通过合并来防止竞争条件Redisson.getLock()?还是RBucket.set()在内部这样做?
Redisson.getLock()
RBucket.set()
一般来说,除了应用程序要求之外,在向 Redisson 设置/获取某些东西之前,我是否需要用锁包围一个块?
实际上,您不需要将 Lock 与 Bucket 对象一起使用,因为所有 redis/redisson 操作都是原子的。