0

I'm using the node-redis client and I'm trying to retrieve a value from my database and then use it later outside the callback like so:

var dbValue = 0;
client.get("myKey", function(err, reply){
      dbValue = reply;
});

console.log(dbValue) //Right now, this would print 0, though it needs to print the value from the database

How does one go about blocking until the value has been updated?

Dan
  • 475
  • 2
  • 5
  • 11

0 Answers0