From 487d0137367c8b46a901b399d9c9b35ba8d95633 Mon Sep 17 00:00:00 2001 From: Xie Han <63350856@qq.com> Date: Wed, 21 Aug 2024 16:11:20 +0800 Subject: [PATCH] Redis subscriber supports PING with a message. --- src/client/WFRedisSubscriber.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/client/WFRedisSubscriber.h b/src/client/WFRedisSubscriber.h index d66fd9e1..66931f9a 100644 --- a/src/client/WFRedisSubscriber.h +++ b/src/client/WFRedisSubscriber.h @@ -62,9 +62,9 @@ public: return this->sync_send("UNSUBSCRIBE", channels); } - int unsubscribe_all() + int unsubscribe() { - return this->unsubscribe(std::vector()); + return this->sync_send("UNSUBSCRIBE", { }); } int psubscribe(const std::vector& patterns) @@ -77,14 +77,19 @@ public: return this->sync_send("PUNSUBSCRIBE", patterns); } - int punsubscribe_all() + int punsubscribe() { - return this->punsubscribe(std::vector()); + return this->sync_send("PUNSUBSCRIBE", { }); + } + + int ping(const std::string& message) + { + return this->sync_send("PING", { message }); } int ping() { - return this->sync_send("PING", std::vector()); + return this->sync_send("PING", { }); } public: