p5-RedisDB / RedisDB

Perl extension to access Redis
22 stars 11 forks source link

How do you do multi in RedisDB::Cluster? #28

Closed theclapp closed 8 years ago

theclapp commented 8 years ago

Do you have any example code for this?

trinitum commented 8 years ago

I don't really do multi on redis cluster myself because of antirez/redis#2515, and at the moment there's no possibility to do this using RedisDB::Cluster. I can relatively easy add to RedisDB::Cluster a method that would return a RedisDB object for a given keyslot, and then you can perform multi/exec on this RedisDB object. This might not work if affected keyslots migrate to another master at some point during the process though.

trinitum commented 8 years ago

I released RedisDB 2.51 which includes node_for_slot and node_for_keys methods. Use one of them to get RedisDB object and then do multi on this object.

theclapp commented 8 years ago

Thanks!