From f39c102eb85dbd53721a71485cf590f2e06589a8 Mon Sep 17 00:00:00 2001 From: Markus Bauer Date: Wed, 6 Nov 2019 12:05:51 +0100 Subject: [PATCH] Add more stubs to redis (pubsub and monitor) (#3442) --- third_party/2and3/redis/client.pyi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/third_party/2and3/redis/client.pyi b/third_party/2and3/redis/client.pyi index 0dec09a0e..13c5eba38 100644 --- a/third_party/2and3/redis/client.pyi +++ b/third_party/2and3/redis/client.pyi @@ -277,6 +277,10 @@ class Redis(object): def script_kill(self): ... def script_load(self, script): ... def register_script(self, script): ... + def pubsub_channels(self, pattern: Text = ...) -> List[Text]: ... + def pubsub_numsub(self, *args: Text) -> List[Tuple[Text, int]]: ... + def pubsub_numpat(self) -> int: ... + def monitor(self) -> Monitor: ... StrictRedis = Redis @@ -350,3 +354,10 @@ class Script: sha: Any def __init__(self, registered_client, script) -> None: ... def __call__(self, keys=..., args=..., client=...): ... + +class Monitor(object): + def __init__(self, connection_pool) -> None: ... + def __enter__(self) -> Monitor: ... + def __exit__(self, *args: Any) -> None: ... + def next_command(self) -> Dict[Text, Any]: ... + def listen(self) -> Iterable[Dict[Text, Any]]: ...