Question

A very basic question, but I couldn't find the answer anywhere (maybe because it's too obvious) :

In node.js (i.e. 'redis' npm module), is a redis store, like other databases, accessible across node.js connections ?

Suppose I set my node.js server up like so

var redis = require("redis"),
    client = redis.createClient();

and suppose I have two separate connections : User A and User B. If User A does

client.set("foo", "bar", redis.print);

and User B (on a different node connection) does

client.get("foo", function (err, reply) {
    console.log(reply.toString());
});

will User B get undefined or will he get 'bar'?

Était-ce utile?

La solution

So long as they are run in the right order that is true.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top