diff options
author | Wen Hui <wen.hui.ware@gmail.com> | 2020-09-20 06:36:20 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-20 13:36:20 +0300 |
commit | dfe9714c867ba69f9ace30c9a9270ae95a111556 (patch) | |
tree | 31cef30b8f52d8254711aaa467f1dd3afb139f69 /src/redismodule.h | |
parent | 1b3b75208c243fe9e18f34c4fb5f0233c2dc5a7f (diff) | |
download | redis-dfe9714c867ba69f9ace30c9a9270ae95a111556.tar.gz |
Add Swapdb Module Event (#7804)
Diffstat (limited to 'src/redismodule.h')
-rw-r--r-- | src/redismodule.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/redismodule.h b/src/redismodule.h index 4a0e5bf15..56011fae0 100644 --- a/src/redismodule.h +++ b/src/redismodule.h @@ -190,6 +190,7 @@ typedef uint64_t RedisModuleTimerID; #define REDISMODULE_EVENT_CRON_LOOP 8 #define REDISMODULE_EVENT_MODULE_CHANGE 9 #define REDISMODULE_EVENT_LOADING_PROGRESS 10 +#define REDISMODULE_EVENT_SWAPDB 11 typedef struct RedisModuleEvent { uint64_t id; /* REDISMODULE_EVENT_... defines. */ @@ -243,6 +244,10 @@ static const RedisModuleEvent RedisModuleEvent_LoadingProgress = { REDISMODULE_EVENT_LOADING_PROGRESS, 1 + }, + RedisModuleEvent_SwapDB = { + REDISMODULE_EVENT_SWAPDB, + 1 }; /* Those are values that are used for the 'subevent' callback argument. */ @@ -374,6 +379,17 @@ typedef struct RedisModuleLoadingProgressInfo { #define RedisModuleLoadingProgress RedisModuleLoadingProgressV1 +#define REDISMODULE_SWAPDBINFO_VERSION 1 +typedef struct RedisModuleSwapDbInfo { + uint64_t version; /* Not used since this structure is never passed + from the module to the core right now. Here + for future compatibility. */ + int32_t dbnum_first; /* Swap Db first dbnum */ + int32_t dbnum_second; /* Swap Db second dbnum */ +} RedisModuleSwapDbInfoV1; + +#define RedisModuleSwapDbInfo RedisModuleSwapDbInfoV1 + /* ------------------------- End of common defines ------------------------ */ #ifndef REDISMODULE_CORE |