summaryrefslogtreecommitdiff
path: root/redis/commands/core.py
diff options
context:
space:
mode:
authordvora-h <67596500+dvora-h@users.noreply.github.com>2022-04-27 16:24:00 +0300
committerGitHub <noreply@github.com>2022-04-27 16:24:00 +0300
commit1f046ac23502521dad280a49ff31263b2e92f4b3 (patch)
tree0e4544e08806adb1a269993b43708525b4d7325f /redis/commands/core.py
parenta696fe5e3155238fd8e9ec65224f94f6f25bb72b (diff)
downloadredis-py-1f046ac23502521dad280a49ff31263b2e92f4b3.tar.gz
Add support for MODULE LOADEX (#2146)
Diffstat (limited to 'redis/commands/core.py')
-rw-r--r--redis/commands/core.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/redis/commands/core.py b/redis/commands/core.py
index e6ab009..fd6ad46 100644
--- a/redis/commands/core.py
+++ b/redis/commands/core.py
@@ -5592,6 +5592,27 @@ class ModuleCommands(CommandsProtocol):
"""
return self.execute_command("MODULE LOAD", path, *args)
+ def module_loadex(
+ self,
+ path: str,
+ options: Optional[List[str]] = None,
+ args: Optional[List[str]] = None,
+ ) -> ResponseT:
+ """
+ Loads a module from a dynamic library at runtime with configuration directives.
+
+ For more information see https://redis.io/commands/module-loadex
+ """
+ pieces = []
+ if options is not None:
+ pieces.append("CONFIG")
+ pieces.extend(options)
+ if args is not None:
+ pieces.append("ARGS")
+ pieces.extend(args)
+
+ return self.execute_command("MODULE LOADEX", path, *pieces)
+
def module_unload(self, name) -> ResponseT:
"""
Unloads the module ``name``.