antirez / redlock-rb

Redlock Redis-based distributed locks implementation in Ruby
BSD 2-Clause "Simplified" License
210 stars 25 forks source link

Could I obtain multi resource by one lock? #4

Open sunkuo opened 7 years ago

sunkuo commented 7 years ago

Hey, Antirez! Would it be better if i can obtain multi resource by one lock . Think about this use case : In a shopping application , when a user place order with multi skus and count, it is a good idea to use Redlock to lock the skus and judge is there enough inventory to sell.

sunkuo commented 7 years ago

I think it is realizable with the command Msetnx and del