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

How to add to pool while it's running? #71

Open
vedmant opened this issue Sep 4, 2019 · 1 comment
Open

How to add to pool while it's running? #71

vedmant opened this issue Sep 4, 2019 · 1 comment

Comments

@vedmant
Copy link

vedmant commented Sep 4, 2019

How can I add work to a pool while it's already running and make it return only that part of work after that part was finished? I need a pool that's is supposed to run multiple requests in a single pool, requests come from different functions and while pool is still running some old requests. The only requirement is to not to run more that a number of requests simultaneously.

@timdp
Copy link
Owner

timdp commented Sep 18, 2019

You'd have to make sure the pool stays active and have the producer function deliver a new promise once it becomes available. While it's feasible using this package, you could also consider Bottleneck or one of Sindre's packages.

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

2 participants