-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix subscribe and unsubscribe command and pattern mode #174
Conversation
- Fix subscribe and psubscribe command reply, the return number is the sum of subscription and psubscription - Fix unpsubscribe command operates on subscription data instead of psubscription - The unsubscribe and punsubscribe commands can operates on more than one channel and pattern - The unsubscribe and punsubscribe commands should have reply
src/redis_cmd.cc
Outdated
conn->UnSubscribeAll(); | ||
SubscribeCommmandReply(output, "unsubscribe", "", | ||
conn->SubscriptionsCount() + conn->PSubscriptionsCount()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in unsubscribe all, a message for every unsubscribed channel will be sent to the client in stock redis (verified on redis v5.0.4), is this response on purpose?
src/redis_cmd.cc
Outdated
if (args_.size() == 1) { | ||
conn->PUnSubscribeAll();; | ||
SubscribeCommmandReply(output, "punsubscribe", "", | ||
conn->SubscriptionsCount() + conn->PSubscriptionsCount()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in punsubscribe all, a message for every punsubscribed channel_patten will be sent to the client in stock redis (verified on redis v5.0.4), is this response on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, i miss that, please have a look again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
is the sum of subscription and psubscription
psubscription
one channel and pattern