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

Function moduleGetReplyClient

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

1504 * client object. Other contexts without associated clients are the ones
1505 * initialized to run the timers callbacks. */
1506client *moduleGetReplyClient(RedisModuleCtx *ctx) {
1507 if (ctx->flags & REDISMODULE_CTX_THREAD_SAFE) {
1508 if (ctx->blocked_client)
1509 return ctx->blocked_client->reply_client;
1510 else
1511 return NULL;
1512 } else {
1513 /* If this is a non thread safe context, just return the client
1514 * that is running the command if any. This may be NULL as well
1515 * in the case of contexts that are not executed with associated
1516 * clients, like timer contexts. */
1517 return ctx->client;
1518 }
1519}
1520
1521/* Send an integer reply to the client, with the specified long long value.
1522 * 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