Comments (11)
Thumbs up for this.
One more scenario: we have a parallel execution of several backend requests via http. When writing this queue I already know, that data from these requests isn't mandatory for the application in common. An app would, of course, gracefully degrade, but will still work.
So, when getting timeout errors (or any other), I still want all other tasks to complete, and, at the same time, I should still be able to log errors in one common callback.
Current option is to handle such errors in methods, that do such requests, and then pass null as the first argument for the callback. It isn't very convinient.
It would be very nice, if I could pass an option to the async to tell it, that I want all tasks to finish even if there were errors.
from async.
Anyone?
from async.
Really want this feature for async.series, async.foreach and async.auto too!
from async.
I want this too. A callback should be called after all tasks are completed, even if any of them failed.
from async.
Plus one as well on this issue, our use case:
Need to try and get information from x amount of different sources, all independent, perfect for parallel, except if one task errors the main call back is called, but after the other x-1 tasks finish the main callback is not called. I would still like to get the information i did get back but since the main call back is never called again after all tasks complete if an error has been thrown i can't get the information available.
If we can wait until all the tasks finish to call the main call back so err an array as well that would be perfect
from async.
Yes, certainly a valid use case. I'm going to work on an API that will do this and various other tweaks for all functions in the near future.
from async.
I'm going to guess you didn't get to this? Still worth doing?
from async.
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its
recipients. This is a temporary error. The following address(es) deferred:
[email protected]
Domain alizweb.com has exceeded the max emails per hour (140/120 (116%)) allowed. Message will be reattempted later
------- This is a copy of the message, including all the headers. ------
Received: from github-smtp2-ext8.iad.github.net ([192.30.252.199]:45132 helo=github-smtp2b-ext-cp1-prd.iad.github.net)
by web107.webhotelli.fi with esmtps (TLSv1:DHE-RSA-AES256-SHA:256)
(Exim 4.82)
(envelope-from [email protected])
id 1WTaNI-0003bw-70
for [email protected]; Fri, 28 Mar 2014 19:15:25 +0200
Date: Fri, 28 Mar 2014 10:15:23 -0700
From: Caolan McMahon [email protected]
Reply-To: caolan/async [email protected]
To: caolan/async [email protected]
Message-ID: caolan/async/issue/51/issue_event/[email protected]
In-Reply-To: caolan/async/issues/[email protected]
References: caolan/async/issues/[email protected]
Subject: Re: [async] Wait to call error callback until currently running
parallel tasks complete (#51)
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_5335ae2b48ba_24333fd1fcd332b418146a";
charset=UTF-8
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Recipient: alizbazar
List-ID: caolan/async <async.caolan.github.com>
List-Archive: https://github.com/caolan/async
List-Post: mailto:[email protected]
List-Unsubscribe: mailto:unsub+i-1593271-bf6ff6ffe838fbf3386711c19738396b40db97c1-736771@reply.github.com,
https://github.com/notifications/unsubscribe/736771__eyJzY29wZSI6Ik5ld3NpZXM6TXV0ZSIsImV4cGlyZXMiOjE3MTE2NDYxMjIsImRhdGEiOnsiaWQiOjEzOTQ4OTF9fQ==--738aff229356c20c115edbcf60f7c74a798919c0
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: [email protected]
----==_mimepart_5335ae2b48ba_24333fd1fcd332b418146a
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Closed #51.
Reply to this email directly or view it on GitHub:
#51
----==_mimepart_5335ae2b48ba_24333fd1fcd332b418146a
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Closed #51.
—
Reply to this email directly or view it on GitHub.
----==_mimepart_5335ae2b48ba_24333fd1fcd332b418146a--
from async.
This default behavior has caused us headaches as well. This feature request was closed, is it in the pipeline or is it just discarded?
from async.
async.queue
is probably a better fit if you need an early exit. If you get an error in the callback to queue.push()
you can call queue.pause()
.
from async.
I won't be changing the default behaviour of async.parallel any time soon - but I understand why this would be needed. Open to other suggestions.
from async.
Related Issues (20)
- functions called by `async.*` return values prematurely? HOT 6
- Is it possible to support `AsyncGenerator` HOT 2
- Support queue.clear besides queue.kill HOT 1
- Multicore HOT 2
- use 'async/mapLimit' in Chrome 43 has error HOT 2
- reflect does not use Error message HOT 1
- Enable OpenSSF Scorecard Github Action and Badge
- How to call functions to execute sequentially? HOT 1
- async package should distribute both cjs and esm HOT 1
- Add adaptive functions HOT 1
- with async.queue order of execution is different when using promises instead of callbacks but should be identical HOT 2
- How to figure version of async required? HOT 1
- Async causing issues with callback function HOT 2
- callback is not a function HOT 3
- Java
- Github
- Vulnerability in the async dependency HOT 1
- vulnerability in async module HOT 2
- Error propagation - Original error lost HOT 4
- How to reproduce Subtle Memory Leak? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from async.