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

Performance improvements and backpressure controls.

Simply and speed up command argument processing logic.
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.
This commit is contained in:
Matt Ranney
2011-06-30 14:03:36 -06:00
parent 13914295a6
commit f9e17556d2
7 changed files with 230 additions and 159 deletions

View File

@@ -45,9 +45,13 @@ Queue.prototype.forEach = function (fn, thisv) {
return array;
};
Queue.prototype.getLength = function () {
return this.head.length - this.offset + this.tail.length;
};
Object.defineProperty(Queue.prototype, 'length', {
get: function () {
return this.head.length - this.offset + this.tail.length;
return this.getLength();
}
});