We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如题,代码里的waiting一直都是0啊?
void pushGenericCommand(redisClient *c, int where) { int j, waiting = 0, pushed = 0; // 取出列表对象 robj *lobj = lookupKeyWrite(c->db,c->argv[1]); // 如果列表对象不存在,那么可能有客户端在等待这个键的出现 int may_have_waiting_clients = (lobj == NULL); if (lobj && lobj->type != REDIS_LIST) { addReply(c,shared.wrongtypeerr); return; } // 将列表状态设置为就绪 if (may_have_waiting_clients) signalListAsReady(c,c->argv[1]); // 遍历所有输入值,并将它们添加到列表中 for (j = 2; j < c->argc; j++) { // 编码值 c->argv[j] = tryObjectEncoding(c->argv[j]); // 如果列表对象不存在,那么创建一个,并关联到数据库 if (!lobj) { lobj = createZiplistObject(); dbAdd(c->db,c->argv[1],lobj); } // 将值推入到列表 listTypePush(lobj,c->argv[j],where); pushed++; } // 返回添加的节点数量 addReplyLongLong(c, waiting + (lobj ? listTypeLength(lobj) : 0)); // 如果至少有一个元素被成功推入,那么执行以下代码 if (pushed) { char *event = (where == REDIS_HEAD) ? "lpush" : "rpush"; // 发送键修改信号 signalModifiedKey(c->db,c->argv[1]); // 发送事件通知 notifyKeyspaceEvent(REDIS_NOTIFY_LIST,event,c->argv[1],c->db->id); } server.dirty += pushed; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
如题,代码里的waiting一直都是0啊?
The text was updated successfully, but these errors were encountered: