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

add temporary results to async.series() functions #52

Closed
tpetry opened this issue Sep 13, 2011 · 3 comments
Closed

add temporary results to async.series() functions #52

tpetry opened this issue Sep 13, 2011 · 3 comments

Comments

@tpetry
Copy link

tpetry commented Sep 13, 2011

By passing the actual result to each function in async series you would be able to use a fantastic code flow as followed:

// this would be any library function
function someFunctionReturningDatabaseObject(callback) {
    callback(null, dbResource);
}

async.series([
     db: someFunctionReturningDatabaseObject,
     query1: function(callback, results) {
         results.db.query('SELECT ....', callback);
     },
     query2: function(callback, results) {
         results.db.query('UPDATE .... WHERE .... = ?', results.query1.columnXYZ, callback);
     }
]);

With the actual async-code this is not possible, you have to use some variables in the scope where the async.series function will be called, the proposed backwards compatible change will allow much cleaner control flows

@nicogranelli
Copy link

I'm not sure, but I think waterfall do just what you want

@tpetry
Copy link
Author

tpetry commented Nov 1, 2011

waterfall only passes the results to the next function. my proposal describes passing all results happend to every function.

@caolan caolan closed this as completed Mar 28, 2014
@alizbazar
Copy link

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:

alizbazar@gmail.com
Domain alizweb.com has exceeded the max emails per hour (131/120 (109%)) allowed. Message will be reattempted later

------- This is a copy of the message, including all the headers. ------
Received: from github-smtp2-ext7.iad.github.net ([192.30.252.198]:44253 helo=github-smtp2a-ext-cp1-prd.iad.github.net)
by web107.webhotelli.fi with esmtps (TLSv1:DHE-RSA-AES256-SHA:256)
(Exim 4.82)
(envelope-from noreply@github.com)
id 1WTaNH-0003br-Jr
for alizbazar@alizweb.com; Fri, 28 Mar 2014 19:15:24 +0200
Date: Fri, 28 Mar 2014 10:15:22 -0700
From: Caolan McMahon notifications@github.com
Reply-To: caolan/async reply@reply.github.com
To: caolan/async async@noreply.github.com
Message-ID: caolan/async/issue/52/issue_event/106554093@github.com
In-Reply-To: caolan/async/issues/52@github.com
References: caolan/async/issues/52@github.com
Subject: Re: [async] add temporary results to async.series() functions (#52)
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_5335ae2a91294_7c9a3f992bedf2c081039";
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:reply@reply.github.com
List-Unsubscribe: mailto:unsub+i-1636383-972acd0b701ed0b13016f7be5847a65f5f8d5583-736771@reply.github.com,
https://github.com/notifications/unsubscribe/736771__eyJzY29wZSI6Ik5ld3NpZXM6TXV0ZSIsImV4cGlyZXMiOjE3MTE2NDYxMjIsImRhdGEiOnsiaWQiOjI4NzgzMTUwfX0=--816d4096808eee53c6b799af1251b77905b421de
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: alizbazar@alizweb.com

----==_mimepart_5335ae2a91294_7c9a3f992bedf2c081039
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit

Closed #52.


Reply to this email directly or view it on GitHub:
#52
----==_mimepart_5335ae2a91294_7c9a3f992bedf2c081039
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit

Closed #52.


Reply to this email directly or view it on GitHub.

----==_mimepart_5335ae2a91294_7c9a3f992bedf2c081039--

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants