Skip to content

Instantly share code, notes, and snippets.

@filipecosta90
Created March 31, 2019 15:50
Show Gist options
  • Save filipecosta90/d35a0dbe916ecfd744b38461d0968a45 to your computer and use it in GitHub Desktop.
Save filipecosta90/d35a0dbe916ecfd744b38461d0968a45 to your computer and use it in GitHub Desktop.
list_extend.c -- step 2 :: RedisModule_OnLoad
int RedisModule_OnLoad(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
if (RedisModule_Init(ctx, "list_extend", 1, REDISMODULE_APIVER_1) == REDISMODULE_ERR)
return REDISMODULE_ERR;
// "write": The command may modify the data set (it may also read from it).
// "deny-oom": The command may use additional memory and should be denied during out of memory conditions.
if (RedisModule_CreateCommand(ctx, "list_extend.filter", ListExtendFilter_RedisCommand, "write deny-oom", 1, 1, 1) == REDISMODULE_ERR)
return REDISMODULE_ERR;
return REDISMODULE_OK;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment