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

Function RM_CreateStringFromStreamID

src/module.cpp:1245–1250  ·  view source on GitHub ↗

Creates a string from a stream ID. The returned string must be released with * RedisModule_FreeString(), unless automatic memory is enabled. * * The passed context `ctx` may be NULL if necessary. See the * RedisModule_CreateString() documentation for more info. */

Source from the content-addressed store, hash-verified

1243 * The passed context `ctx` may be NULL if necessary. See the
1244 * RedisModule_CreateString() documentation for more info. */
1245RedisModuleString *RM_CreateStringFromStreamID(RedisModuleCtx *ctx, const RedisModuleStreamID *id) {
1246 streamID streamid = {id->ms, id->seq};
1247 RedisModuleString *o = createObjectFromStreamID(&streamid);
1248 if (ctx != NULL) autoMemoryAdd(ctx, REDISMODULE_AM_STRING, o);
1249 return o;
1250}
1251
1252/* Free a module string object obtained with one of the Redis modules API calls
1253 * that return new string objects.

Callers

nothing calls this directly

Calls 2

createObjectFromStreamIDFunction · 0.85
autoMemoryAddFunction · 0.85

Tested by

no test coverage detected