Questions tagged [node-async]

Async is a utility module for node.js (although it can also be used in the browser) that provides powerful functions for working with asynchronous JavaScript

Async provides around 20 functions that include the usual 'functional' suspects (map, reduce, filter, each...) as well as some common patterns for asynchronous control flow (parallel, series, waterfall...).

All these functions assume you follow the convention of providing a single callback as the last argument of your async function.


Documentation :

185 questions
0
votes
1 answer

Zombiejs - fetching contents of links synchronouly

I have been playing with nodejs and zombiejs to fetch some personal data from a site. Unfortunately I am stuck at a point where zombiejs only gets me the data from first link and then hangsup. The steps I follow are- Go to to the base url Get the…
vijay
  • 75
  • 1
  • 5
0
votes
2 answers

how to synchronize 2 async.waterfalls

I have a set of read commands that I have to in sequence. Any fails, processing stops. readCommands is an array of read functions... async.waterfall(readCommands, function(err) { if (err) { console.log(err); res.send(500, {…
reza
  • 5,972
  • 15
  • 84
  • 126
0
votes
1 answer

how to use async.waterfall with an existing of callbacks

I have an array of command objects. I need to call the do command, this is an asynchronous call, on each of the array elements, in sequence. If any fail, I need to stop processing. I know how to do the async.waterfall call for individuals async…
reza
  • 5,972
  • 15
  • 84
  • 126
0
votes
1 answer

Does node-async handle the common 'fetch in parallel' workflow?

I frequently find myself writing functions to handle an array of items: An asynchronous function run many timesin parallel, with each function using a different item of the array as its argument A counter that fires once all the functions have…
mikemaccana
  • 110,530
  • 99
  • 389
  • 494
0
votes
1 answer

async.waterfall returns only the resultset of function at array[0] index of array of functions - node js

The following code returns only the resultset of getpricingSummary async.waterfall([ function(callback){ getpricingSummary(elementsParam, function(workloadinfo) { callback(workloadinfo); }); }, …
Prem
  • 5,685
  • 15
  • 52
  • 95
0
votes
3 answers

Parallel Flow in Node Modules

I am having an express app. I want to have parallel flow for an array of functions that I want to run. I am thinking of using async module for doing so. I want to know if there is any other module which will be more better than this? Secondly I…
Saransh Mohapatra
  • 9,430
  • 10
  • 39
  • 50
0
votes
3 answers

Best method to string together variety of DB calls in Node js

I basically need to make about 3 calls to get the data for a json object.. It basically JSON array of JSON object which have some attributes, one of which is an array of other values selected using a second query, then that one also has an array…
Tolga E
  • 12,188
  • 15
  • 49
  • 61
0
votes
1 answer

Using async with Node

I'm attempting to write a simple validation script in Node where error codes are added to an error array when certain validation checks fail. To complicate things, I also have a function called translate which makes a database call and returns the…
David Jones
  • 10,117
  • 28
  • 91
  • 139
0
votes
1 answer

async.series and javascript variables

I think there's a fundamental disconnect in my understanding. I've been reading up on callbacks and I've searched for why the following might not work, but I may be looking in the wrong places. I have the following code: users = [] …
0
votes
1 answer

Using nodejs async to process a large xml file (with relationships)

I have to process a large XML file (around 25 mb in size), and organize the data into documents to import into MongoDB. The issue is, there are around 5-6 types of elements in the xml document, each with around 10k rows. After fetching one xml…
Munim
  • 6,310
  • 2
  • 35
  • 44
0
votes
3 answers

Not every function in Async.js series executes

I'm attempting to use Async.js to fire a series of asynchronous functions. Below is my code. Only the first two functions execute. The third and fourth functions in the series do not execute. I've simplified the functions thinking to the most…
hughesdan
  • 3,019
  • 12
  • 57
  • 80
0
votes
2 answers

Async parallel bug?

Here I'm trying to make an array of functions with arguments to Async.js. The array consists of instances of RunRequest that are supposed to be set inside the loop in MakeRequest, right before I try pass the function array to Async. So the request…
Josh Elias
  • 3,250
  • 7
  • 42
  • 73
-1
votes
1 answer

Node Express - Database is created too late causing error

My problem is with creating a database. It is created too late and causes problems with further queries. I tried to use async and await but it seems it doesn't solve the problem. async function storeDailyDealToDB(dailyDeal) { const db = new…
deadfish
  • 11,996
  • 12
  • 87
  • 136
-1
votes
1 answer

Aysnc for each callback issue

I am using async for each to achieve some task the problem i am facing is that the final call back never executes Scenario : i have list of contacts and want to send message to all contacts in parallel and when message is send want to store the…
Kumail Hussain
  • 869
  • 2
  • 26
  • 49
-1
votes
2 answers

Unable to export variables in async node js files to other nodejs files

I am trying to export variable output to another node js file. But due to async task of fs read function, I am unable to export output variable. I am unable to understand where I am making mistake. I am just getting output as undefined. Could anyone…
1 2 3
12
13