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

pls consider throwing obvious error when limit is a non-positive integer #1331

Closed
ORESoftware opened this issue Nov 29, 2016 · 5 comments
Closed

Comments

@ORESoftware
Copy link
Contributor

On latest version of async

I tried (for the heck of it), a limit of 0

const async = require('async');

async.eachLimit([ 1, 2, 3 ], 0, function (item, cb) {
  console.log('item => ', item);
  process.nextTick(cb)
}, function (err) {
  console.log('error => ',err);
});

just curious what the rationale is for not throwing an error or not passing an error back in the final callback (that may be new Error('Concurrency of 0 is not valid') or whatever?

@ORESoftware ORESoftware changed the title pls throw obvious error when limit is a non-positive integer pls consider throwing obvious error when limit is a non-positive integer Nov 29, 2016
@aearly aearly added this to the 3.0 milestone Nov 29, 2016
@aearly
Copy link
Collaborator

aearly commented Nov 29, 2016

👍 for throwing an error, but it would be a breaking change.

@ORESoftware
Copy link
Contributor Author

It's actually a feature because you can skip to the final callback, I just think that there should be an error there. If the user wants to ignore the error, they can do that.
Definitely understand that it would be a breaking change.

@megawac
Copy link
Collaborator

megawac commented Nov 29, 2016

Closing as dupe of #1249

@megawac megawac closed this as completed Nov 29, 2016
@megawac
Copy link
Collaborator

megawac commented Nov 29, 2016

I would be fine with doing this in a minor release and considering it a bug fix. Thoughts @aearly?

@aearly
Copy link
Collaborator

aearly commented Nov 29, 2016

I'd consider it a breaking change. Some people might be using or inadvertently relying on that strange behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants