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

Function RM_UnblockClient

app/redis-6.2.6/src/module.c:5517–5527  ·  view source on GitHub ↗

Unblock a client blocked by `RedisModule_BlockedClient`. This will trigger * the reply callbacks to be called in order to reply to the client. * The 'privdata' argument will be accessible by the reply callback, so * the caller of this function can pass any value that is needed in order to * actually reply to the client. * * A common usage for 'privdata' is a thread that computes something th

Source from the content-addressed store, hash-verified

5515 * RedisModule_BlockClientOnKeys() is accessible from the timeout
5516 * callback via RM_GetBlockedClientPrivateData). */
5517int RM_UnblockClient(RedisModuleBlockedClient *bc, void *privdata) {
5518 if (bc->blocked_on_keys) {
5519 /* In theory the user should always pass the timeout handler as an
5520 * argument, but better to be safe than sorry. */
5521 if (bc->timeout_callback == NULL) return REDISMODULE_ERR;
5522 if (bc->unblocked) return REDISMODULE_OK;
5523 if (bc->client) moduleBlockedClientTimedOut(bc->client);
5524 }
5525 moduleUnblockClientByHandle(bc,privdata);
5526 return REDISMODULE_OK;
5527}
5528
5529/* Abort a blocked client blocking operation: the client will be unblocked
5530 * without firing any callback. */

Callers 1

RM_AbortBlockFunction · 0.85

Calls 2

Tested by

no test coverage detected