Mehran
Mehran

Reputation: 16851

Do I need to lock before setting some bucket in redisson?

If I want to set a bucket in Redisson, do I need to prevent race condition by incorporating Redisson.getLock()? Or RBucket.set() does that internally?

In general, other than application requirements, is there any scenario that I need to surround a block by locks before setting / getting something to / from Redisson?

Upvotes: 0

Views: 973

Answers (1)

Nikita Koksharov
Nikita Koksharov

Reputation: 10793

Actually you don't need to use Lock with Bucket object, because all redis/redisson operations are atomic.

Upvotes: 1

Related Questions