MCPcopy Create free account
hub / github.com/F-Stack/f-stack / RM_GetClientInfoById

Function RM_GetClientInfoById

app/redis-6.2.6/src/module.c:2007–2015  ·  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

2005 * }
2006 */
2007int RM_GetClientInfoById(void *ci, uint64_t id) {
2008 client *client = lookupClientByID(id);
2009 if (client == NULL) return REDISMODULE_ERR;
2010 if (ci == NULL) return REDISMODULE_OK;
2011
2012 /* Fill the info structure if passed. */
2013 uint64_t structver = ((uint64_t*)ci)[0];
2014 return modulePopulateClientInfoStructure(ci,client,structver);
2015}
2016
2017/* Publish a message to subscribers (see PUBLISH command). */
2018int RM_PublishMessage(RedisModuleCtx *ctx, RedisModuleString *channel, RedisModuleString *message) {

Callers

nothing calls this directly

Calls 2

lookupClientByIDFunction · 0.85

Tested by

no test coverage detected