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

Function addClientToTimeoutTable

app/redis-6.2.6/src/timeout.c:114–121  ·  view source on GitHub ↗

Add the specified client id / timeout as a key in the radix tree we use * to handle blocked clients timeouts. The client is not added to the list * if its timeout is zero (block forever). */

Source from the content-addressed store, hash-verified

112 * to handle blocked clients timeouts. The client is not added to the list
113 * if its timeout is zero (block forever). */
114void addClientToTimeoutTable(client *c) {
115 if (c->bpop.timeout == 0) return;
116 uint64_t timeout = c->bpop.timeout;
117 unsigned char buf[CLIENT_ST_KEYLEN];
118 encodeTimeoutKey(buf,timeout,c);
119 if (raxTryInsert(server.clients_timeout_table,buf,sizeof(buf),NULL,NULL))
120 c->flags |= CLIENT_IN_TO_TABLE;
121}
122
123/* Remove the client from the table when it is unblocked for reasons
124 * different than timing out. */

Callers 1

blockClientFunction · 0.85

Calls 2

encodeTimeoutKeyFunction · 0.85
raxTryInsertFunction · 0.85

Tested by

no test coverage detected