Merge pull request #14172 from fenying/master

redis - add methods cork and uncork for RedisClient.
This commit is contained in:
Bowden Kelly
2017-02-03 18:33:08 -08:00
committed by GitHub
2 changed files with 17 additions and 1 deletions
+10
View File
@@ -94,6 +94,16 @@ export interface RedisClient extends NodeJS.EventEmitter {
end(): void;
unref(): void;
/**
* Stop sending commands and queue the commands.
*/
cork(): void;
/**
* Resume and send the queued commands at once.
*/
uncork(): void;
// Low level command execution
send_command(command: string, ...args: any[]): boolean;
+7 -1
View File
@@ -112,4 +112,10 @@ client.monitor(resCallback);
// Send command
client.send_command(str, args, resCallback);
// Duplicate
client.duplicate();
client.duplicate();
// Pipeline
client.cork();
client.set("abc", "fff", strCallback);
client.get("abc", resCallback);
client.uncork();