1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

Add unref() method to RedisClient that will call unref() on the socket connection, allowing it to close when unused. This is experimental because it does not yet understand the Redis protocol, so subscriptions or blocking operations will not work correctly.

This commit is contained in:
Bryce Baril
2013-10-02 16:10:26 -07:00
parent 5f125b51d4
commit b12c49a207
4 changed files with 64 additions and 0 deletions

12
test-unref.js Normal file
View File

@@ -0,0 +1,12 @@
var redis = require("./")
//redis.debug_mode = true
var PORT = process.argv[2] || 6379;
var HOST = process.argv[3] || '127.0.0.1';
var c = redis.createClient(PORT, HOST)
c.unref()
c.info(function (err, reply) {
if (err) process.exit(-1)
if (!reply.length) process.exit(-1)
process.stdout.write(reply.length.toString())
})