summaryrefslogtreecommitdiff
path: root/async.c
diff options
context:
space:
mode:
authorBjorn Svensson <bjorn.a.svensson@est.tech>2021-12-01 20:43:23 +0100
committerGitHub <noreply@github.com>2021-12-01 11:43:23 -0800
commitda5a4ff3622e8744b772a76f6ce580dc9134fb38 (patch)
tree100af25c22aa05feafa810b123392e80efa4071c /async.c
parentb5716ee82926316f7764b834eec636f5652d5600 (diff)
Add asynchronous test for pubsub using RESP3 (#1012)
* Include `unsubscribe` as a subscribe reply in RESP3 By providing the (p)unsubscribe message via the subscribe callback, instead of via the push callback, we get the same behavior in RESP3 as in RESP2. * Add asynchronous test for pubsub using RESP3 The testcase will subscribe to a channel, and via a second client a message is published to the channel. After receiving the message the testcase will unsubscribe and disconnect. This RESP3 testcase reuses the subscribe callback from the RESP2 testcase to make sure we have a common behavior.
Diffstat (limited to 'async.c')
-rw-r--r--async.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/async.c b/async.c
index e37afbd..4459c19 100644
--- a/async.c
+++ b/async.c
@@ -496,8 +496,8 @@ static int redisIsSubscribeReply(redisReply *reply) {
len = reply->element[0]->len - off;
return !strncasecmp(str, "subscribe", len) ||
- !strncasecmp(str, "message", len);
-
+ !strncasecmp(str, "message", len) ||
+ !strncasecmp(str, "unsubscribe", len);
}
void redisProcessCallbacks(redisAsyncContext *ac) {