1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Refactor pipelining

This commit is contained in:
Ruben Bridgewater
2016-04-14 00:57:34 +02:00
parent 5d12659583
commit 683815de9d
4 changed files with 47 additions and 54 deletions

View File

@@ -121,12 +121,12 @@ describe('The node_redis client', function () {
str += str;
}
var called = false;
var temp = client.writeBuffers.bind(client);
assert(String(client.writeBuffers) !== String(client.writeDefault));
client.writeBuffers = function (data) {
var temp = client.write_buffers.bind(client);
assert(client.fire_strings);
client.write_buffers = function (data) {
called = true;
// To increase write performance for strings the value is converted to a buffer
assert(String(client.writeBuffers) === String(client.writeDefault));
assert(!client.fire_strings);
temp(data);
};
client.multi().set('foo', str).get('foo', function (err, res) {
@@ -136,7 +136,7 @@ describe('The node_redis client', function () {
assert.strictEqual(res[1], str);
done();
});
assert(String(client.writeBuffers) !== String(client.writeDefault));
assert(client.fire_strings);
});
});