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

Promise.all with concurrency limitation implementation #122

Open
windmemory opened this issue Oct 7, 2020 · 3 comments
Open

Promise.all with concurrency limitation implementation #122

windmemory opened this issue Oct 7, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@windmemory
Copy link
Member

Related to wechaty/puppet-service#31

Currently the code logic for roomSearch in wechaty-puppet is not using batch operation, like below:

https://github.com/wechaty/wechaty-puppet/blob/804b31b970e931547238d59de43847178a2869cd/src/puppet.ts#L1174-L1212

When the query is passed to the function, it will do a Promise.all() of all rooms, which might cause the problem that we've been fighting for a long time, the grpc issue. So I think we need to use batch operation for this method to avoid the grpc problem.

@huan
Copy link
Member

huan commented Oct 8, 2020

Thank your very much for this great improvement!

@windmemory
Copy link
Member Author

Let's close this issue since the problem should be fixed.

@huan huan added the enhancement New feature or request label Mar 22, 2021
@huan huan reopened this Aug 17, 2021
@huan
Copy link
Member

huan commented Aug 17, 2021

I'm planning to use async pool or iterator worker or p-map to implement a Promise.all() with a concurrency limitation for a better performance.

@huan huan changed the title roomSearch using Promise.all might cause hostie connection issue Promise.all with concurrency limitation implementation Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants