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

Function RM_ReplyWithDouble

src/module.cpp:1778–1786  ·  view source on GitHub ↗

Send a string reply obtained converting the double 'd' into a bulk string. * This function is basically equivalent to converting a double into * a string into a C buffer, and then calling the function * RedisModule_ReplyWithStringBuffer() with the buffer and length. * * The function always returns REDISMODULE_OK. */

Source from the content-addressed store, hash-verified

1776 *
1777 * The function always returns REDISMODULE_OK. */
1778int RM_ReplyWithDouble(RedisModuleCtx *ctx, double d) {
1779 client *c = moduleGetReplyClient(ctx);
1780 if (c == NULL) return REDISMODULE_OK;
1781 AeLocker locker;
1782 std::unique_lock<fastlock> lock(c->lock);
1783 locker.arm(c);
1784 addReplyDouble(c,d);
1785 return REDISMODULE_OK;
1786}
1787
1788/* Send a string reply obtained converting the long double 'ld' into a bulk
1789 * string. This function is basically equivalent to converting a long double

Callers

nothing calls this directly

Calls 3

moduleGetReplyClientFunction · 0.85
addReplyDoubleFunction · 0.85
armMethod · 0.80

Tested by

no test coverage detected