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

发布订阅模式的代码写得有问题吧 #409

Open
GeorgeHcc opened this issue Oct 16, 2023 · 0 comments
Open

发布订阅模式的代码写得有问题吧 #409

GeorgeHcc opened this issue Oct 16, 2023 · 0 comments

Comments

@GeorgeHcc
Copy link

image
上图中,你针对不同type遍历对应的listener里的回调,然后参数是messages[type]??
这样做,如果我发布了多个相同type=A的消息,但是只有一个人订阅,循环也就只执行一次,就只拿messages[0]第一条消息??

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

No branches or pull requests

1 participant