1 var redis = require("../index"),
2 client = redis.createClient(null, null, {
3 command_queue_high_water: 5,
4 command_queue_low_water: 1
6 remaining_ops = 100000, paused = false;
9 if (remaining_ops <= 0) {
10 console.error("Finished.");
15 if (client.hset("test hash", "val " + remaining_ops, remaining_ops) === false) {
16 console.log("Pausing at " + remaining_ops);
23 client.on("drain", function () {
25 console.log("Resuming at " + remaining_ops);
29 console.log("Got drain while not paused at " + remaining_ops);