Questions tagged [async.js]

A module with functions for working asynchronously with JavaScript that can be used both in NodeJS and in the browser.

Async is a utility module which provides straight-forward, powerful functions for working with . Although originally designed for use with , it can also be used directly in the browser.

Resources

944 questions
-1
votes
1 answer

How can I call a function after async.forEachOfSeries completes it's task

I need to call a function after async.forEachOfSeries completes it's task. I have an Object named rows. It contains postId and other information. I need to make a request inside the funtion abc() to get comments of that particular post and save them…
Araf
  • 189
  • 3
  • 12
-1
votes
2 answers

how do I return values from an async each function?

I know this is a common problem for people, and I've looked up some guides and looked at the docs, but I'm not understanding what is happening, and would love some help. Here is the controller function I am working on: exports.appDetail = function…
Brian
  • 325
  • 2
  • 13
-1
votes
1 answer

How can I figure out which nodeunit is causing async errors more quickly?

I ran into an issue while testing a fairly large refactor (on this case taking moving an old service from node.js 0.12 to 10.x). We use grunt so I got the following results out of grunt nodeunit:all: ... verify-api.routes.test.js test setValues…
darrin
  • 629
  • 4
  • 18
-1
votes
1 answer

Nodejs using async.parallel & async/wait. Is there any better way to do this

Is a better way to do this, below code works, what I am trying to do is, read schedule.json file Process each primary schedules synchronously Sub schedules can be run in parallel const async = require('async'); const schedule = { …
bobby.dreamer
  • 178
  • 2
  • 12
-1
votes
1 answer

JavaScript Handle Asynchronous Callbacks node .js

I am new to Javascript and just got stuck with async callbacks with Javascript using Node.js. I first set up the Facebook webhook and make a Webhook POST request Here is my code : routes.js **To set up facebook webhook** var facebook_handler =…
aram
  • 61
  • 1
  • 9
-1
votes
1 answer

async errors with function call inside nested async loop

I am working on a pothole map, and am on the stage where I load pothole data from the server and put it on the map as markers. Since data retrieval and the APIs that my app relies on (Roads, Geolocation, etc.) are asynchronous, my code ended up…
Mike Warren
  • 3,042
  • 4
  • 29
  • 76
-1
votes
1 answer

async.js: iterate a collection until one returns true

I'm very happy with what async.js can do, but it seems to be missing one thing that I need it to do right now: I have an array containing data. [{"name": "bob", "age":15}, {"name": "bill", "age":19}, {"name": "john", "age": 24}] I want to call…
devman
  • 544
  • 6
  • 18
-1
votes
2 answers

Executing multiple HTTP requests sequentially using async.js

How can I execute multiple HTTP requests sequentially using async.js . I checked the async.js documentation but couldn't figure out, how to do that. I want to achieve the same thing as below code using async.js callback style. var http =…
Mahtab Alam
  • 1,445
  • 3
  • 20
  • 29
-1
votes
2 answers

Node Express Can't set headers after they are sent

I know this has been asked in multiple ways already, but my issue seems to be different from those already posted. I'm trying to send data from a form into google firebase. I have a node app using express. Here's my function that is sending the…
thekeegs
  • 33
  • 6
-1
votes
1 answer

async - Execute action after loop completed in javascript

I'm trying to develop a synchronous process in node.js, and I have implemented the async.series method, but the way of I've implemented is not working as I expect. I expect the second function of the series works after the first function terminate…
pedro.olimpio
  • 1,415
  • 19
  • 35
-1
votes
1 answer

Callback was already called in async.map

Edit: "threads"+"async" modules are not async(if not thread) safe! It was being called by another async function! Thats why thread running it twice before a single async completed. There was some code leftovers calling same code asynchronously. Here…
huseyin tugrul buyukisik
  • 9,464
  • 3
  • 39
  • 81
-1
votes
1 answer

Running Functions Synchronously in NodeJS (MongoDB Operations/Async.js)

I'm trying to do something fairly simple it seems in NodeJS - I want to run functions, one at a time. All of these functions have callbacks. I have outlined my code below, as well as the function that they run for further reference. My problem is…
-1
votes
1 answer

How to implement set of async task with some condition in series?

I have to write the following code in nodejs: val1 = async1() if(val1 == 0){ val1 = async2() } val2 = async3(val1) In the above code, val1 and val2 are the values returned from asyncronous functions async1(), async2() and async3() How can I…
Vishal
  • 437
  • 1
  • 7
  • 17
-1
votes
1 answer

Async: run single function

All async.js operators seem to be made for collections only. Is there a way to run this piece of code: async.series([ function (callback) { TripDao.getTrip(callback); }], function done(error, result)…
Amio.io
  • 17,083
  • 11
  • 66
  • 100
-1
votes
1 answer

Writing asynchronously to a text file using async.mapLimit

I'm trying to write numbers between 1 and 100 (order isn't important) to my text file, but only 99 is added. What's wrong here? app.get('/async', function(req, res) { // I create my array here. var arr = []; for (a = 0; a <= 100; a++) { …
salep
  • 1,120
  • 8
  • 38
  • 83
1 2 3
62
63