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

Function RM_ReplyWithCallReply

src/module.cpp:1761–1770  ·  view source on GitHub ↗

Reply exactly what a Redis command returned us with RedisModule_Call(). * This function is useful when we use RedisModule_Call() in order to * execute some command, as we want to reply to the client exactly the * same reply we obtained by the command. * * The function always returns REDISMODULE_OK. */

Source from the content-addressed store, hash-verified

1759 *
1760 * The function always returns REDISMODULE_OK. */
1761int RM_ReplyWithCallReply(RedisModuleCtx *ctx, RedisModuleCallReply *reply) {
1762 client *c = moduleGetReplyClient(ctx);
1763 if (c == NULL) return REDISMODULE_OK;
1764 AeLocker locker;
1765 std::unique_lock<fastlock> lock(c->lock);
1766 locker.arm(c);
1767 sds proto = sdsnewlen(reply->proto, reply->protolen);
1768 addReplySds(c,proto);
1769 return REDISMODULE_OK;
1770}
1771
1772/* Send a string reply obtained converting the double 'd' into a bulk string.
1773 * This function is basically equivalent to converting a double into

Callers

nothing calls this directly

Calls 4

moduleGetReplyClientFunction · 0.85
sdsnewlenFunction · 0.85
addReplySdsFunction · 0.85
armMethod · 0.80

Tested by

no test coverage detected