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

Add WFRedisSubscriber to support redis subscribe/psubscribe. #1608

Merged
merged 12 commits into from
Aug 20, 2024

Conversation

Barenboim
Copy link
Contributor

No description provided.

@Barenboim Barenboim force-pushed the subscribe branch 7 times, most recently from f78d25e to f899da0 Compare August 17, 2024 20:54
Comment on lines 379 to 382
const char *str = reply->element[0]->str;

if (strcasecmp(str, "unsubscribe") == 0 ||
strcasecmp(str, "punsubscribe") == 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

		const char *str = reply->element[0]->str;
		size_t len = reply->element[0]->len;

		if ((len == 11 && strncasecmp(str, "unsubscribe", 11) == 0) ||
			(len == 12 && strncasecmp(str, "punsubscribe", 12) == 0))

task_->watching_ = true;
task_->extract_(task_);

task_->clear_resp();
Copy link
Contributor

Choose a reason for hiding this comment

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

clear_resp()使得ProtocolMessage::wrapper信息丢掉了

@Barenboim Barenboim linked an issue Aug 19, 2024 that may be closed by this pull request
@kedixa
Copy link
Contributor

kedixa commented Aug 19, 2024

👍🏻

@Barenboim Barenboim force-pushed the subscribe branch 2 times, most recently from 647ab3d to ae4b589 Compare August 19, 2024 17:22
@Barenboim Barenboim merged commit 65de9c4 into sogou:master Aug 20, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

关于redis sub/pub问题
2 participants