Sha256: cdc8dcc87fa0c99f603285a9e9871dfc1b2a00cb5b85f22cb9134390b88af1a1

Contents?: true

Size: 776 Bytes

Versions: 33

Compression:

Stored size: 776 Bytes

Contents

var redis  = require("redis"),
    client = redis.createClient(), multi;

// start a separate command queue for multi
multi = client.multi();
multi.incr("incr thing", redis.print);
multi.incr("incr other thing", redis.print);

// runs immediately
client.mset("incr thing", 100, "incr other thing", 1, redis.print);

// drains multi queue and runs atomically
multi.exec(function (err, replies) {
    console.log(replies); // 101, 2
});

// you can re-run the same transaction if you like
multi.exec(function (err, replies) {
    console.log(replies); // 102, 3
    client.quit();
});

client.multi([
    ["mget", "multifoo", "multibar", redis.print],
    ["incr", "multifoo"],
    ["incr", "multibar"]
]).exec(function (err, replies) {
    console.log(replies.toString());
});

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/multi2.js
hooch-0.4.1 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/multi2.js
hooch-0.4.0 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/multi2.js
hooch-0.3.0 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/multi2.js
hooch-0.2.1 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/multi2.js
hooch-0.2.0 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/multi2.js
hooch-0.1.0 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/multi2.js
hooch-0.0.8 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/multi2.js
hooch-0.0.7 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/multi2.js
hooch-0.0.6 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/multi2.js
entangled-0.0.16 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/multi2.js
entangled-0.0.15 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/multi2.js
entangled-0.0.14 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/multi2.js
entangled-0.0.13 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/multi2.js
entangled-0.0.12 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/multi2.js
entangled-0.0.11 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/multi2.js
entangled-0.0.10 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/examples/multi2.js
express_translate-1.0.13 node_modules/redis/examples/multi2.js
express_translate-1.0.12 node_modules/redis/examples/multi2.js
express_translate-1.0.11 node_modules/redis/examples/multi2.js