node_redis_cluster
node_redis_cluster copied to clipboard
Function r.multi() returns undefined object
Object everything works fine my code, gets to this line of code:
var multi = r.multi();
Object multi gets undefined. Do you have an idea maybe?
I should also mention, that if i use r.get and r.set the system works fine, but i should use transactions.
If you use a linux like system there is no need to use multi() due of driver async behaviour...
Of course i need to use multi(), because i need to prevent that between get and set command, no other process reads that property or changes it.
I think that's not about linux drivers async behaviour.
I hope i got your point.
You are right but not when you use hiredis async lib
in the cluster mode... Whole bulk of received data is processed by each redis instance, so no other process can be in a middle state.. But anyway, I'll add a multi
to "fast-driver" for backward compatibility.
BTW do not forget that each command of "multi" may be executed on different redis...
Thanks.
Thanks for this quick reply and help. I will check on this hiredis async lib also.
Yeah I understand that but before my multi call i only close one key value, which is always in the same cluster server because of redis hash function so i would not have problems with that. Thank you.
Please, let me know about the improvement that I can download it. Thank you. :+1:
I am sorry, have no time to check it against cluster driver, could you please check it?
In your project directory go to node_modules/redis-cluster/node_modules
delete a redis-fast-driver
folder and make a clone by git clone -b fake-multi https://github.com/h0x91b/redis-fast-driver.git
then cd redis-fast-driver
and compile it by npm install
then run your code... Sorry, but I am really busy today..
repo itself there: https://github.com/h0x91b/redis-fast-driver/tree/fake-multi
Sorry that i bother you so much, but even if then fix, r.multi() returns undefined object.
I checked the code, but could understand it enough that i could figure out what is going on. If you would find some time in future days i would appreciate it. Thanks for your help so far!
I just check your example script and command is returning multi object as expected. But if i change example library of that library command returns undefined.
Ok, no problem, I`ll do it tomorrow