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

Function RM_GetClientInfoById

src/module.cpp:2086–2094  ·  view source on GitHub ↗

Return information about the client with the specified ID (that was * previously obtained via the RedisModule_GetClientId() API). If the * client exists, REDISMODULE_OK is returned, otherwise REDISMODULE_ERR * is returned. * * When the client exist and the `ci` pointer is not NULL, but points to * a structure of type RedisModuleClientInfo, previously initialized with * the correct REDISMODU

Source from the content-addressed store, hash-verified

2084 * }
2085 */
2086int RM_GetClientInfoById(void *ci, uint64_t id) {
2087 client *client = lookupClientByID(id);
2088 if (client == NULL) return REDISMODULE_ERR;
2089 if (ci == NULL) return REDISMODULE_OK;
2090
2091 /* Fill the info structure if passed. */
2092 uint64_t structver = ((uint64_t*)ci)[0];
2093 return modulePopulateClientInfoStructure(ci,client,structver);
2094}
2095
2096/* Publish a message to subscribers (see PUBLISH command). */
2097int RM_PublishMessage(RedisModuleCtx *ctx, RedisModuleString *channel, RedisModuleString *message) {

Callers

nothing calls this directly

Calls 2

lookupClientByIDFunction · 0.85

Tested by

no test coverage detected