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

'Some/Detect' ControlFlow #591

Closed
paraggupta1993 opened this issue Aug 7, 2014 · 2 comments
Closed

'Some/Detect' ControlFlow #591

paraggupta1993 opened this issue Aug 7, 2014 · 2 comments

Comments

@paraggupta1993
Copy link

Is there a way to run 'n' asynchronous functions in parallel such that it will pass the callback with no error when say some ( or atleast 1 ) function didn't returned err.

Use Case :

  1. Suppose, I am making 'n' API calls for the data to 'n' different servers. Even if one of them returned me the data and rest (n-1) returned me error, I should be able to use this data calling the 'final callback' with no-error.
  2. While making 'n' API calls, the-final callback is called immediately as soon as one function returned the data.

If there exists a way, Kindly tell.

Thanks.

@aearly
Copy link
Collaborator

aearly commented May 19, 2015

This seems similar to #568

@aearly
Copy link
Collaborator

aearly commented Jun 2, 2015

Closing this in favor of #568. Note that there is already async.detect, that exits when it receives a truthy value, but it doesn't follow node conventions exactly, so it could be cumbersome to use.

@aearly aearly closed this as completed Jun 2, 2015
This was referenced Feb 8, 2017
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

2 participants