From 886b3355e1ff278d5c070ea01d72fb03c2035fcb Mon Sep 17 00:00:00 2001 From: Matt Ranney Date: Thu, 30 Jun 2011 14:29:58 -0600 Subject: [PATCH] Bugs fixed: * authentication retry while server is loading db (danmaz74) [GH-101] * command arguments processing issue with arrays New features: * Auto update of new commands from redis.io (Dave Hoover) * Performance improvements and backpressure controls. * Commands now return the true/false value from the underlying socket write(s). * Implement command_queue high water and low water for more better control of queueing. See `examples/backpressure_drain.js` for more information. --- changelog.md | 16 +++++++++++++++- examples/backpressure_drain.js | 33 +++++++++++++++++++++++++++++++++ package.json | 2 +- 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 examples/backpressure_drain.js diff --git a/changelog.md b/changelog.md index 473442fe2ab..0ffd954b594 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,21 @@ Changelog ========= -Auto update of new commands from redis.io (Dave Hoover) +## v0.6.2 - June 30, 2011 + +Bugs fixed: + +* authentication retry while server is loading db (danmaz74) [GH-101] +* command arguments processing issue with arrays + +New features: + +* Auto update of new commands from redis.io (Dave Hoover) +* Performance improvements and backpressure controls. +* Commands now return the true/false value from the underlying socket write(s). +* Implement command_queue high water and low water for more better control of queueing. + +See `examples/backpressure_drain.js` for more information. ## v0.6.1 - June 29, 2011 diff --git a/examples/backpressure_drain.js b/examples/backpressure_drain.js new file mode 100644 index 00000000000..a64456e8def --- /dev/null +++ b/examples/backpressure_drain.js @@ -0,0 +1,33 @@ +var redis = require("../index"), + client = redis.createClient(null, null, { + command_queue_high_water: 5, + command_queue_low_water: 1 + }), + remaining_ops = 10000, paused = false; + +function op() { + if (remaining_ops <= 0) { + console.error("Finished."); + process.exit(0); + } + + remaining_ops--; + if (client.hset("test hash", "val " + remaining_ops, remaining_ops) === false) { + console.log("Pausing at " + remaining_ops); + paused = true; + } else { + process.nextTick(op); + } +} + +client.on("drain", function () { + if (paused) { + console.log("Resuming at " + remaining_ops); + paused = false; + process.nextTick(op); + } else { + console.log("Got drain while not paused at " + remaining_ops); + } +}); + +op(); diff --git a/package.json b/package.json index 6b8c8be8311..dbf42e5cb4e 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { "name" : "redis", - "version" : "0.6.1", + "version" : "0.6.2", "description" : "Redis client library", "author": "Matt Ranney ", "contributors": [