Currently, the valkeymodule-rs crate is using RedisModule_* APIs for all operations / interactions with the server. This works since internally in the Valkey, these APIs point to the equivalent ValkeyModule_* APIs.
For the official Valkey Modules, it would be more correct to use the ValkeyModule_* APIs by default.
We can support a new feature flag - use-redismodule-api and if a unofficial Valkey Module would like to, underneath, call the RedisModule_* APIs, they can build their module using this flag. Otherwise, by default, all interactions with the server will go through ValkeyModule_* APIs.
Use case:
Allow official Valkey Rust Modules to use ValkeyModule_* APIs by default.
And provide Unofficial Valkey Rust Modules a feature flag to opt-in to using RedisModule_ APIs.
Changes needed:
Support a use-redismodule-api feature flag and implement logic to support both cases.
This will need changes in the following places:
Currently, the valkeymodule-rs crate is using RedisModule_* APIs for all operations / interactions with the server. This works since internally in the Valkey, these APIs point to the equivalent ValkeyModule_* APIs.
For the official Valkey Modules, it would be more correct to use the ValkeyModule_* APIs by default.
We can support a new feature flag -
use-redismodule-apiand if a unofficial Valkey Module would like to, underneath, call the RedisModule_* APIs, they can build their module using this flag. Otherwise, by default, all interactions with the server will go throughValkeyModule_*APIs.Use case:
Allow official Valkey Rust Modules to use ValkeyModule_* APIs by default.
And provide Unofficial Valkey Rust Modules a feature flag to opt-in to using RedisModule_ APIs.
Changes needed:
Support a
use-redismodule-apifeature flag and implement logic to support both cases.This will need changes in the following places:
extern "C"functions that will use either RedisModule_ or ValkeyModule_ function parameters.ValkeyString,Context,ValkeyKey,ValkeyType,StreamRecord, many more) are based on raw RedisModule_* structures, flags, constants. We can either switch completely to ValkeyModule_ [this is preferred] or maintain two versions [not preferred].