From 1f046ac23502521dad280a49ff31263b2e92f4b3 Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Wed, 27 Apr 2022 16:24:00 +0300 Subject: Add support for MODULE LOADEX (#2146) --- redis/commands/core.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'redis') 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``. -- cgit v1.2.1