As some of you may have noticed, the RC1 release of redis 4.0, a few days ago, introduced a breaking API change to the way modules register data types.
Basically, instead of calling RedisModule_CreateDataType with a long list of callbacks, you give that function a single struct containing all those callbacks as members.
For example, this is from my own search module, that has a prefix tree (trie) type.
Before the change, the code looked like so:
TrieType = RedisModule_CreateDataType(ctx, "trietype0", 0, TrieType_RdbLoad,
TrieType_RdbSave, TrieType_AofRewrite,
TrieType_Digest, TrieType_Free);
After the change it looks like:
RedisModuleTypeMethods tm = {.version = REDISMODULE_TYPE_METHOD_VERSION,
.rdb_load = TrieType_RdbLoad,
.rdb_save = TrieType_RdbSave,
.aof_rewrite = TrieType_AofRewrite,
.free = TrieType_Free};
TrieType = RedisModule_CreateDataType(ctx, "trietype0", 0, &tm);
The reason for this is to allow the future extending of the API with more calls, without breaking compatibility.
As you can see the change is really trivial. It was done on the last second to prevent any future breakage after the API is stable.
Sorry for not announcing it properly on the list right after the change :)