Skip to content

Commit 5f48028

Browse files
committed
Merge pull request DefinitelyTyped#5445 from MugeSo/redis-update-to-0.12.1
Redis update to 0.12.1
2 parents 43a433a + 83d5bc7 commit 5f48028

File tree

2 files changed

+633
-335
lines changed

2 files changed

+633
-335
lines changed

redis/redis-tests.ts

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import redis = require('redis');
44

55
var value: any;
66
var valueArr: any[];
7+
var commandArr: any[][];
78
var num: number;
89
var str: string;
910
var bool: boolean;
@@ -40,6 +41,7 @@ client.end();
4041
// Connection (http://redis.io/commands#connection)
4142
client.auth(str, resCallback);
4243
client.ping(numCallback);
44+
client.unref();
4345

4446
// Strings (http://redis.io/commands#strings)
4547
client.append(str, str, numCallback);
@@ -49,9 +51,7 @@ client.set(str, str, strCallback);
4951
client.get(str, strCallback);
5052
client.exists(str, numCallback);
5153

52-
client.publish(str, value);
53-
client.subscribe(str);
54-
54+
// Event handlers
5555
client.on(str, messageHandler);
5656
client.once(str, messageHandler);
5757

@@ -62,5 +62,31 @@ client.get(args);
6262
client.get(args, resCallback);
6363
client.set(args);
6464
client.set(args, resCallback);
65+
client.mset(args, resCallback);
6566

6667
client.incr(str, resCallback);
68+
69+
// Friendlier hash commands
70+
client.hgetall(str, resCallback);
71+
client.hmset(str, value, resCallback);
72+
client.hmset(str, str, str, str, str, resCallback);
73+
74+
// Publish / Subscribe
75+
client.publish(str, value);
76+
client.subscribe(str);
77+
78+
// Multi
79+
client.multi()
80+
.scard(str)
81+
.smembers(str)
82+
.keys('*', resCallback)
83+
.dbsize()
84+
.exec(resCallback);
85+
86+
client.multi(commandArr).exec();
87+
88+
// Monitor mode
89+
client.monitor(resCallback);
90+
91+
// Send command
92+
client.send_command(str, args, resCallback);

0 commit comments

Comments
 (0)