-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
async.queue and concurrency #747
Comments
Is this related to #512 ? As far as I know, there's no clean way to change the concurrency on the fly. |
no, On Sat, Apr 18, 2015 at 9:23 PM, Alexander Early notifications@github.com
*Filippo Privitera *| Head of Technology Milan | Rome | New York | Shanghai Beintoo Spa - Corso di Porta Romana, 68 - 20122 Milano - Italy - Office This email is reserved exclusively for sending and receiving messages |
why we don't add a function on async.queue like this?
|
@fprivitera is half right. The concurrency is only updated when new items are pushed onto the queue. That behavior can be fixed without adding the proposed |
I need to revise that statement to say "The concurrency can only be updated on the same event loop in which an item was added to the queue. And it can only be decreased, not increased." I just added a failing test case. There was previously a test case for changing concurrency but it didn't correctly test situations where the concurrency can't be changed. |
I think @justincy 's fix is good enough for now. If you want the queue to immediately take into account the new concurrency, you can manually call |
if I change onthefly the q.concurrency (of var q=async.queue(... ) ) there is no change happening.
are there any other workarounds?
thanks
The text was updated successfully, but these errors were encountered: