-
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
A solution for stoping a flow after an early exit #1064
Comments
Hmnn, this is very intriguing! I like that there is precedent in restify. It also seems like |
@megawac What do you think about this? |
Works for me (in a major bump) - would be nice for the On Wed, Mar 30, 2016 at 2:58 PM, Alex Early notifications@github.com
|
Yeah, I agree, we should save it for the next major. The breaking change we made with predicate-style functions (e.g. |
Not having this is very inconvenient. I support the use of |
Think I will be hammering on some of these breaking changes over the weekend. @hargasinski @aearly any thoughts on a 3.0 timeline? December perhaps? |
Do we have any stats on how widely used v2 is? I wouldn't want to have more breaking changes for people to evaluate while most people still haven't upgraded. |
We should probably do a minor 2.1 release with the changes applied in #1261 and a non-breaking fix for #1293 before 3.0. The docs will also get updated with the changes in PRs, such as #1263, #1271, and #1280, which will be helpful. @aearly, that's good point. 2.0 will have been released for 6 months in December. Should we assume that will be enough time for most users to update? We could use the changelog to write a migration guide in the Wiki for 1.5 to 3.0. |
This is now somewhat possible with |
@megawac is there a link to any documentation for this (async/internal/breakLoop)? Not seeing anything on the site so far. |
I'd be hesitant to use it, as we are not fully decided that this is how we want to handle early exits. We could change this later, breaking your code. |
https://libraries.io has some great version stats: https://libraries.io/npm/async/usage I broke down the percent of 20% of dependents are v2.0+. (v1.5.2 is our most widely used version, though, ~22%). v2.0 has been in the wild for a year. I think we can start thinking about v3. |
There are a strong requirement that stop a flow normally instead of call callback with a fake err. I find a solution from restify:
So only
null
to indicate a error, andfalse
for normal terminal.callback(false)
will stop the flow, but won't active error handle likeif (err) console.log(err)
.The text was updated successfully, but these errors were encountered: