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

Function RM_ReplyWithLongDouble

src/module.cpp:1796–1804  ·  view source on GitHub ↗

Send a string reply obtained converting the long double 'ld' into a bulk * string. This function is basically equivalent to converting a long double * into a string into a C buffer, and then calling the function * RedisModule_ReplyWithStringBuffer() with the buffer and length. * The double string uses human readable formatting (see * `addReplyHumanLongDouble` in networking.c). * * The funct

Source from the content-addressed store, hash-verified

1794 *
1795 * The function always returns REDISMODULE_OK. */
1796int RM_ReplyWithLongDouble(RedisModuleCtx *ctx, long double ld) {
1797 client *c = moduleGetReplyClient(ctx);
1798 if (c == NULL) return REDISMODULE_OK;
1799 AeLocker locker;
1800 std::unique_lock<fastlock> lock(c->lock);
1801 locker.arm(c);
1802 addReplyHumanLongDouble(c, ld);
1803 return REDISMODULE_OK;
1804}
1805
1806/* --------------------------------------------------------------------------
1807 * ## Commands replication API

Callers

nothing calls this directly

Calls 3

moduleGetReplyClientFunction · 0.85
addReplyHumanLongDoubleFunction · 0.85
armMethod · 0.80

Tested by

no test coverage detected