Coder Social home page Coder Social logo

Comments (11)

Flackus avatar Flackus commented on June 19, 2024

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.

Flackus avatar Flackus commented on June 19, 2024

Anyone?

from async.

ifeltsweet avatar ifeltsweet commented on June 19, 2024

Really want this feature for async.series, async.foreach and async.auto too!

from async.

shaoshuai0102 avatar shaoshuai0102 commented on June 19, 2024

I want this too. A callback should be called after all tasks are completed, even if any of them failed.

from async.

jason-patel-ensighten avatar jason-patel-ensighten commented on June 19, 2024

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.

caolan avatar caolan commented on June 19, 2024

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.

bitwiseman avatar bitwiseman commented on June 19, 2024

I'm going to guess you didn't get to this? Still worth doing?

from async.

alizbazar avatar alizbazar commented on June 19, 2024

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.

jfstgermain avatar jfstgermain commented on June 19, 2024

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.

aearly avatar aearly commented on June 19, 2024

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.

caolan avatar caolan commented on June 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.