Sorry the implementation changed again and again. I recently fixed the optimistic locking feature (a.k.a CAS operation), But I've considered a better implementation for the feature in the cluster client. I haven't convinced the previous implementation at a point that users incur to use two receivers depending on the use case. So this pull request makes receivers consolidated.
Before
redis.watch("{my}key") do |client|
if redis.get("{my}key") == "some value" # <= this receiver
client.multi do |tx|
tx.set("{my}key", "other value")
tx.incr("{my}counter")
end
else
client.unwatch
end
end
After
redis.watch("{my}key") do |client|
if client.get("{my}key") == "some value" # <= this receiver
client.multi do |tx|
tx.set("{my}key", "other value")
tx.incr("{my}counter")
end
else
client.unwatch
end
end
1255
1265
1267
1268
Sorry the implementation changed again and again. I recently fixed the optimistic locking feature (a.k.a CAS operation), But I've considered a better implementation for the feature in the cluster client. I haven't convinced the previous implementation at a point that users incur to use two receivers depending on the use case. So this pull request makes receivers consolidated.
Before
After