I use synchronize package in order to run async call to redis in sync manner. The problem is it looks like I don't use it properly.
For example,
sync.fiber(function(){
var data = sync.await(utils.cleanredis("offer", sync.defer()))
console.log(data)
})
function cleanredis(string, callback)
client.select(2, function() {
client.smembers(string, function(err, replies) {
callback(err, replies)
})
})
}
The above code, works completely well when client is connected to the redis which installed on the localhost. However, when I try to connect redis to the remote host it doesn't give any output (in async manner it works)
I think the problem is I am not actually synchronize the code, the first version works just because it's very fast call to redis, and the second fails because here the call is not immediate.
I tried to find sync version of redis, but with no success. In addition, I am not able to rewrite the entire application in async manner. I just want to add calls to redis in sync manner.
Thank you.