mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Modules hooks: do more in example client callback.
This commit is contained in:
parent
cf52e0ad44
commit
c379fdbae2
@ -41,8 +41,13 @@
|
|||||||
void clientChangeCallback(RedisModuleCtx *ctx, RedisModuleEvent e, uint64_t sub, void *data)
|
void clientChangeCallback(RedisModuleCtx *ctx, RedisModuleEvent e, uint64_t sub, void *data)
|
||||||
{
|
{
|
||||||
REDISMODULE_NOT_USED(ctx);
|
REDISMODULE_NOT_USED(ctx);
|
||||||
|
REDISMODULE_NOT_USED(e);
|
||||||
|
|
||||||
RedisModuleClientInfo *ci = data;
|
RedisModuleClientInfo *ci = data;
|
||||||
printf("Client event for client #%llu %s:%d\n",ci->id,ci->addr,ci->port);
|
printf("Client %s event for client #%llu %s:%d\n",
|
||||||
|
(sub == REDISMODULE_SUBEVENT_CLIENT_CHANGE_CONNECTED) ?
|
||||||
|
"connection" : "disconnection",
|
||||||
|
ci->id,ci->addr,ci->port);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function must be present on each Redis module. It is used in order to
|
/* This function must be present on each Redis module. It is used in order to
|
||||||
|
Loading…
Reference in New Issue
Block a user