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

async.someLimit #548

Closed
wants to merge 4 commits into from
Closed

async.someLimit #548

wants to merge 4 commits into from

Conversation

mtone
Copy link
Contributor

@mtone mtone commented Jun 11, 2014

Was getting crashes on file IO operations involving network shares. Since async.some is a wrapper for async.each, and async.eachLimit already exists, addition appears straightforward.

mtone added 4 commits June 9, 2014 21:37
When checking if a folder contains subfolders or not (fs.readdir -> fs.stat -> some(is_a_Folder)), getting crashes when listing Windows shares from Ubuntu VM. someLimit avoids the problem.
@aearly
Copy link
Collaborator

aearly commented Jun 12, 2014

The general strategy for having async collection methods is to use async.mapLimit() and then use filter, some, every, etc.. on the result. However, having a someLimit() function that short-circuits would be handy...

@aearly aearly added the feature label May 21, 2015
@@ -582,6 +583,27 @@ async.some(['file1','file2','file3'], fs.exists, function(result){

---------------------------------------

<a name="someLimit" />
### someLimit(arr, limit iterator, callback)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you need a comma between limit and iterator

@megawac
Copy link
Collaborator

megawac commented Jul 2, 2015

The general strategy for having async collection methods is to use async.mapLimit() and then use filter, some, every, etc.. on the result. However, having a someLimit() function that short-circuits would be handy...

@aearly would you reconsider if it adds pretty much no LOC

@aearly
Copy link
Collaborator

aearly commented Jul 2, 2015

I'd be happy with whatever implementation as long as it also includes lots of LOC in tests. 😄

@aearly aearly closed this in #828 Jul 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants