-
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: throw error if called with a concurrency of 0 #714
Labels
Comments
PR #762 |
Ah, i see that it's possible to change the concurrency after the initalisation. Edit: it's not possible to throw an error after the initalisation because we can't assert that the concurrency isn't zero since it's just a variable. Further on we should assert that the concurrency isn't a negative value. |
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I recently had this code:
Things queued never called the callback because
os.cpus
is a function that takes 0 arguments. Thusos.cpus.length
returns 0 and the queue never does anything. The correct code would beos.cpus().length
, notice the()
.Maybe it would be a good idea to throw an error to alert the user that the queue was initialised with 0 concurrency and thus never will run anything.
The text was updated successfully, but these errors were encountered: