문제

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'?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top