MCPcopy Create free account
hub / github.com/F-Stack/f-stack / blmoveGenericCommand

Function blmoveGenericCommand

app/redis-6.2.6/src/t_list.c:991–1011  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

989}
990
991void blmoveGenericCommand(client *c, int wherefrom, int whereto, mstime_t timeout) {
992 robj *key = lookupKeyWrite(c->db, c->argv[1]);
993 if (checkType(c,key,OBJ_LIST)) return;
994
995 if (key == NULL) {
996 if (c->flags & CLIENT_DENY_BLOCKING) {
997 /* Blocking against an empty list when blocking is not allowed
998 * returns immediately. */
999 addReplyNull(c);
1000 } else {
1001 /* The list is empty and the client blocks. */
1002 struct listPos pos = {wherefrom, whereto};
1003 blockForKeys(c,BLOCKED_LIST,c->argv + 1,1,timeout,c->argv[2],&pos,NULL);
1004 }
1005 } else {
1006 /* The list exists and has elements, so
1007 * the regular lmoveCommand is executed. */
1008 serverAssertWithInfo(c,key,listTypeLength(key) > 0);
1009 lmoveGenericCommand(c,wherefrom,whereto);
1010 }
1011}
1012
1013/* BLMOVE <source> <destination> (LEFT|RIGHT) (LEFT|RIGHT) <timeout> */
1014void blmoveCommand(client *c) {

Callers 2

blmoveCommandFunction · 0.85
brpoplpushCommandFunction · 0.85

Calls 6

lookupKeyWriteFunction · 0.85
checkTypeFunction · 0.85
addReplyNullFunction · 0.85
blockForKeysFunction · 0.85
listTypeLengthFunction · 0.85
lmoveGenericCommandFunction · 0.85

Tested by

no test coverage detected