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

Function RM_ReplyWithSimpleString

src/module.cpp:1559–1566  ·  view source on GitHub ↗

Reply with a simple string (`+... \r\n` in RESP protocol). This replies * are suitable only when sending a small non-binary string with small * overhead, like "OK" or similar replies. * * The function always returns REDISMODULE_OK. */

Source from the content-addressed store, hash-verified

1557 *
1558 * The function always returns REDISMODULE_OK. */
1559int RM_ReplyWithSimpleString(RedisModuleCtx *ctx, const char *msg) {
1560 client *c = moduleGetReplyClient(ctx);
1561 if (c == NULL) return REDISMODULE_OK;
1562 addReplyProto(c,"+",1);
1563 addReplyProto(c,msg,strlen(msg));
1564 addReplyProto(c,"\r\n",2);
1565 return REDISMODULE_OK;
1566}
1567
1568/* Reply with an array type of 'len' elements. However 'len' other calls
1569 * to `ReplyWith*` style functions must follow in order to emit the elements

Callers

nothing calls this directly

Calls 2

moduleGetReplyClientFunction · 0.85
addReplyProtoFunction · 0.85

Tested by

no test coverage detected