You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Things queued never called the callback because os.cpus is a function that takes 0 arguments. Thus os.cpus.length returns 0 and the queue never does anything. The correct code would be os.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:
LinusU
changed the title
async.queue: throw error if called wit a concurrency of 0
async.queue: throw error if called with a concurrency of 0
Feb 12, 2015
Ah, i see that it's possible to change the concurrency after the initalisation.
I will update my PR later.
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.
Especially in browser it would cause problems.
Further on we should assert that the concurrency isn't a negative value.
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: