You've already forked node-redis
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user