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

Remove command queue high and low water marks

This commit is contained in:
Ruben Bridgewater
2015-10-28 23:51:00 +01:00
parent 4e5e4635aa
commit afc4989495
6 changed files with 11 additions and 14 deletions

View File

@@ -1,10 +1,7 @@
'use strict';
var redis = require('../index'),
client = redis.createClient(null, null, {
command_queue_high_water: 5,
command_queue_low_water: 1
}),
client = redis.createClient(),
remaining_ops = 100000, paused = false;
function op() {
@@ -14,11 +11,12 @@ function op() {
}
remaining_ops--;
if (client.hset('test hash', 'val ' + remaining_ops, remaining_ops) === false) {
client.hset('test hash', 'val ' + remaining_ops, remaining_ops);
if (client.should_buffer === true) {
console.log('Pausing at ' + remaining_ops);
paused = true;
} else {
process.nextTick(op);
setTimeout(op, 1);
}
}