You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
Organize examples.
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
// Note - Eventually this functionality will be built in to the client library
|
||||
|
||||
var redis = require("redis"),
|
||||
client = redis.createClient();
|
||||
|
||||
// whenever the client connects, make sure
|
||||
// whenever the client connects, make sure to auth
|
||||
client.on("connect", function () {
|
||||
client.auth("somepass", redis.print);
|
||||
});
|
@@ -1,3 +1,5 @@
|
||||
// Read a file from disk, store it in Redis, then read it back from Redis.
|
||||
|
||||
var redis = require("redis"),
|
||||
client = redis.createClient(),
|
||||
fs = require("fs"),
|
@@ -4,6 +4,7 @@ var redis = require("redis"),
|
||||
|
||||
redis.debug_mode = false;
|
||||
|
||||
// Most clients probably don't do much on "subscribe". This example uses it to coordinate things within one program.
|
||||
client1.on("subscribe", function (channel, count) {
|
||||
console.log("client1 subscribed to " + channel + ", " + count + " total subscriptions");
|
||||
if (count === 2) {
|
Reference in New Issue
Block a user