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

Function moduleGetReplyClient

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

Return the client object the `RM_Reply*` functions should target. * Normally this is just `ctx->client`, that is the client that called * the module command, however in the case of thread safe contexts there * is no directly associated client (since it would not be safe to access * the client from a thread), so instead the blocked client object referenced * in the thread safe context, has a f

Source from the content-addressed store, hash-verified

1477 * client object. Other contexts without associated clients are the ones
1478 * initialized to run the timers callbacks. */
1479client *moduleGetReplyClient(RedisModuleCtx *ctx) {
1480 if (ctx->flags & REDISMODULE_CTX_THREAD_SAFE) {
1481 if (ctx->blocked_client)
1482 return ctx->blocked_client->reply_client;
1483 else
1484 return NULL;
1485 } else {
1486 /* If this is a non thread safe context, just return the client
1487 * that is running the command if any. This may be NULL as well
1488 * in the case of contexts that are not executed with associated
1489 * clients, like timer contexts. */
1490 return ctx->client;
1491 }
1492}
1493
1494/* Send an integer reply to the client, with the specified long long value.
1495 * The function always returns REDISMODULE_OK. */

Callers 15

RM_ReplyWithLongLongFunction · 0.85
RM_ReplyWithErrorFunction · 0.85
RM_ReplyWithSimpleStringFunction · 0.85
RM_ReplyWithArrayFunction · 0.85
RM_ReplyWithNullArrayFunction · 0.85
RM_ReplyWithEmptyArrayFunction · 0.85
RM_ReplySetArrayLengthFunction · 0.85
RM_ReplyWithStringBufferFunction · 0.85
RM_ReplyWithCStringFunction · 0.85
RM_ReplyWithStringFunction · 0.85
RM_ReplyWithEmptyStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected