Sha256: e1f2d9d28a19f05c54282e871eecf951d4b3ab647375caaff30d804467dd60c1

Contents?: true

Size: 810 Bytes

Versions: 33

Compression:

Stored size: 810 Bytes

Contents

var redis = require("../index"),
    client = redis.createClient(null, null, {
        command_queue_high_water: 5,
        command_queue_low_water: 1
    }),
    remaining_ops = 100000, paused = false;

function op() {
    if (remaining_ops <= 0) {
        console.error("Finished.");
        process.exit(0);
    }

    remaining_ops--;
    if (client.hset("test hash", "val " + remaining_ops, remaining_ops) === false) {
        console.log("Pausing at " + remaining_ops);
        paused = true;
    } else {
        process.nextTick(op);
    }
}

client.on("drain", function () {
    if (paused) {
        console.log("Resuming at " + remaining_ops);
        paused = false;
        process.nextTick(op);
    } else {
        console.log("Got drain while not paused at " + remaining_ops);
    }
});

op();

Version data entries

33 entries across 33 versions & 4 rubygems

Version Path
hooch-0.4.2 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/backpressure_drain.js
hooch-0.4.1 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/backpressure_drain.js
hooch-0.4.0 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/backpressure_drain.js
hooch-0.3.0 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/backpressure_drain.js
hooch-0.2.1 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/backpressure_drain.js
hooch-0.2.0 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/backpressure_drain.js
hooch-0.1.0 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/backpressure_drain.js
hooch-0.0.8 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/backpressure_drain.js
hooch-0.0.7 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/backpressure_drain.js
hooch-0.0.6 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/backpressure_drain.js
entangled-0.0.16 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/backpressure_drain.js
entangled-0.0.15 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/backpressure_drain.js
entangled-0.0.14 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/backpressure_drain.js
entangled-0.0.13 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/backpressure_drain.js
entangled-0.0.12 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/backpressure_drain.js
entangled-0.0.11 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/backpressure_drain.js
entangled-0.0.10 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/backpressure_drain.js
express_translate-1.0.13 node_modules/redis/examples/backpressure_drain.js
express_translate-1.0.12 node_modules/redis/examples/backpressure_drain.js
express_translate-1.0.11 node_modules/redis/examples/backpressure_drain.js