Added methods cork and uncork for RedisClient.

This commit is contained in:
Angus.Fenying 2017-01-22 16:17:37 +08:00
parent 756433aeb4
commit 453ffc9e8a
2 changed files with 17 additions and 1 deletions

10
redis/index.d.ts vendored
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;

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();