1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +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);
}
}

View File

@@ -4,7 +4,7 @@ var redis = require('redis'),
client1 = redis.createClient(), msg_count = 0,
client2 = redis.createClient();
// Most clients probably don't do much on 'subscribe'. This example uses it to coordinate things within one program.
// 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) {