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

Function moduleUnblockClientByHandle

src/module.cpp:5581–5591  ·  view source on GitHub ↗

Implements RM_UnblockClient() and moduleUnblockClient(). */

Source from the content-addressed store, hash-verified

5579
5580/* Implements RM_UnblockClient() and moduleUnblockClient(). */
5581int moduleUnblockClientByHandle(RedisModuleBlockedClient *bc, void *privdata) {
5582 pthread_mutex_lock(&moduleUnblockedClientsMutex);
5583 if (!bc->blocked_on_keys) bc->privdata = privdata;
5584 bc->unblocked = 1;
5585 listAddNodeTail(moduleUnblockedClients,bc);
5586 if (write(g_pserver->module_blocked_pipe[1],"A",1) != 1) {
5587 /* Ignore the error, this is best-effort. */
5588 }
5589 pthread_mutex_unlock(&moduleUnblockedClientsMutex);
5590 return REDISMODULE_OK;
5591}
5592
5593/* This API is used by the Redis core to unblock a client that was blocked
5594 * by a module. */

Callers 2

moduleUnblockClientFunction · 0.85
RM_UnblockClientFunction · 0.85

Calls 1

listAddNodeTailFunction · 0.85

Tested by

no test coverage detected