Skip to content
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

Merged
merged 3 commits into from
Feb 5, 2021
Merged

Fix subscribe and unsubscribe command and pattern mode #174

merged 3 commits into from
Feb 5, 2021

Conversation

ShooterIT
Copy link
Member

  • 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

- 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());
Copy link
Contributor

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());
Copy link
Contributor

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?

Copy link
Member Author

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.

@ShooterIT ShooterIT requested a review from karelrooted February 5, 2021 05:36
Copy link
Contributor

@karelrooted karelrooted left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@karelrooted karelrooted merged commit e657d58 into apache:master Feb 5, 2021
@ShooterIT ShooterIT mentioned this pull request Feb 8, 2021
@ShooterIT ShooterIT deleted the subscribe branch March 11, 2021 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants