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

Change concurrency level after initialization #8

Open
slumbi opened this issue May 17, 2018 · 1 comment
Open

Change concurrency level after initialization #8

slumbi opened this issue May 17, 2018 · 1 comment

Comments

@slumbi
Copy link

slumbi commented May 17, 2018

Currently it is possible to decrease the concurrency of the queue, and it behaves as expected.
Increasing it however does not work, because each time a task finishes , only one new task gets executed instead of one task per available slot ( concurrency-busyCount )

This feature would allow to dynamically change processing speed, and even pause the jobs for a period of time.

@jjrv
Copy link
Member

jjrv commented May 17, 2018

I guess TaskQueue should have a setConcurrency method that also calls next when increasing it, to immediately start new eligible tasks before previous ones finish.

Then next could have a loop like:

while(this.busyCount < this.concurrency) { ... }

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