Streams: XLEN command.
This commit is contained in:
parent
64a7ad038d
commit
760ad8f65c
@ -304,6 +304,7 @@ struct redisCommand redisCommandTable[] = {
|
|||||||
{"pfdebug",pfdebugCommand,-3,"w",0,NULL,0,0,0,0,0},
|
{"pfdebug",pfdebugCommand,-3,"w",0,NULL,0,0,0,0,0},
|
||||||
{"xadd",xaddCommand,-4,"wmF",0,NULL,1,1,1,0,0},
|
{"xadd",xaddCommand,-4,"wmF",0,NULL,1,1,1,0,0},
|
||||||
{"xrange",xrangeCommand,-4,"r",0,NULL,1,1,1,0,0},
|
{"xrange",xrangeCommand,-4,"r",0,NULL,1,1,1,0,0},
|
||||||
|
{"xlen",xlenCommand,2,"rF",0,NULL,1,1,1,0,0},
|
||||||
{"post",securityWarningCommand,-1,"lt",0,NULL,0,0,0,0,0},
|
{"post",securityWarningCommand,-1,"lt",0,NULL,0,0,0,0,0},
|
||||||
{"host:",securityWarningCommand,-1,"lt",0,NULL,0,0,0,0,0},
|
{"host:",securityWarningCommand,-1,"lt",0,NULL,0,0,0,0,0},
|
||||||
{"latency",latencyCommand,-2,"aslt",0,NULL,0,0,0,0,0}
|
{"latency",latencyCommand,-2,"aslt",0,NULL,0,0,0,0,0}
|
||||||
|
@ -2001,6 +2001,7 @@ void moduleCommand(client *c);
|
|||||||
void securityWarningCommand(client *c);
|
void securityWarningCommand(client *c);
|
||||||
void xaddCommand(client *c);
|
void xaddCommand(client *c);
|
||||||
void xrangeCommand(client *c);
|
void xrangeCommand(client *c);
|
||||||
|
void xlenCommand(client *c);
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
void *calloc(size_t count, size_t size) __attribute__ ((deprecated));
|
void *calloc(size_t count, size_t size) __attribute__ ((deprecated));
|
||||||
|
@ -378,3 +378,12 @@ void xrangeCommand(client *c) {
|
|||||||
s = o->ptr;
|
s = o->ptr;
|
||||||
streamReplyWithRange(c,s,&startid,&endid,count);
|
streamReplyWithRange(c,s,&startid,&endid,count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* XLEN */
|
||||||
|
void xlenCommand(client *c) {
|
||||||
|
robj *o;
|
||||||
|
if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.czero)) == NULL
|
||||||
|
|| checkType(c,o,OBJ_STREAM)) return;
|
||||||
|
stream *s = o->ptr;
|
||||||
|
addReplyLongLong(c,s->length);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user