[ioredis] Add xadd definitions to support MAXLEN argument

This commit is contained in:
Ting-Wai To
2019-02-17 01:13:42 -08:00
parent 3d0bd7c754
commit 0c02ca4f73
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -489,6 +489,8 @@ declare namespace IORedis {
xack(key: KeyType, group: string, ...ids: string[]): any;
xadd(key: KeyType, id: string, ...args: string[]): any;
xadd(key: KeyType, maxLenOption: 'MAXLEN' | 'maxlen', count: number, ...args: string[]): any;
xadd(key: KeyType, maxLenOption: 'MAXLEN' | 'maxlen', approximate: '~', count: number, ...args: string[]): any;
xclaim(key: KeyType, group: string, consumer: string, minIdleTime: number, ...args: any[]): any;
+2
View File
@@ -177,6 +177,8 @@ new Redis.Cluster([{
redis.xack('streamName', 'groupName', 'id');
redis.xadd('streamName', '*', 'field', 'name');
redis.xadd('streamName', 'MAXLEN', 100, '*', 'field', 'name');
redis.xadd('streamName', 'MAXLEN', '~', 100, '*', 'field', 'name');
redis.xclaim('streamName', 'groupName', 'consumerName', 3600000, 'id');
redis.xdel('streamName', 'id');
redis.xgroup('CREATE', 'streamName', 'groupName', '$');