MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / RM_UnblockClient

Function RM_UnblockClient

src/module.cpp:5626–5637  ·  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

5624 * RedisModule_BlockClientOnKeys() is accessible from the timeout
5625 * callback via RM_GetBlockedClientPrivateData). */
5626int RM_UnblockClient(RedisModuleBlockedClient *bc, void *privdata) {
5627 moduleSetThreadVariablesIfNeeded();
5628 if (bc->blocked_on_keys) {
5629 /* In theory the user should always pass the timeout handler as an
5630 * argument, but better to be safe than sorry. */
5631 if (bc->timeout_callback == NULL) return REDISMODULE_ERR;
5632 if (bc->unblocked) return REDISMODULE_OK;
5633 if (bc->client) moduleBlockedClientTimedOut(bc->client);
5634 }
5635 moduleUnblockClientByHandle(bc,privdata);
5636 return REDISMODULE_OK;
5637}
5638
5639/* Abort a blocked client blocking operation: the client will be unblocked
5640 * without firing any callback. */

Callers 1

RM_AbortBlockFunction · 0.85

Tested by

no test coverage detected