async.js Questions

3

Solved

I wrote a script that creates a new excel file with ExcelJS. Adds 3 headers and inserts 2 rows. Then saves that file to disk. In the next step it should read that previously saved file, add 1 row...
Graziano asked 13/3, 2019 at 0:48

10

Solved

Using mongoskin, I can do a query like this, which will return a cursor: myCollection.find({}, function(err, resultCursor) { resultCursor.each(function(err, result) { } } However, I'd like to...
Tainataint asked 8/8, 2013 at 6:36

2

Solved

I have a Promise.allSettled which i use to resolve data in the database. I have an array of Promises which I run through the Promise.allSettled, then I only use the resolved ones. Is it possible to...
Bedder asked 3/12, 2020 at 10:9

1

I have this async function in a file called index.main.js which has a variable , 'targetFiles' which I would like to export to another file which is index.js. Problem is I can't find a way to expor...
Dugaid asked 5/7, 2019 at 1:46

1

I wrote an async function that needs to call a program in the server and that program generate a file which needs to load in UI for displaying. I am not sure how to show the result in my UI since e...
Prochoras asked 9/12, 2018 at 16:56

2

Solved

I am making call to the bitbucket API to get all the files that are in a repo. I have reached to a point where I can get the list of all the folders in the repo and make the first API call to all t...
Ignace asked 16/10, 2018 at 19:6

1

I need to do some movements on page while page exists (or is opened). But other async code can close it in any time. I try to use code, like this: async.whilst( function(){ /*TEST function: retur...
Konyn asked 26/9, 2017 at 10:53

1

Solved

I have this right now: export type EVCb = (err:any, val?:any) => void; export type Task = (cb: EVCb) => void; export const q = async.queue((task: Task, cb) => task(cb), 2); Isn't there ...
Trivandrum asked 25/6, 2018 at 21:51

2

Solved

Recently asked such a question. What is faster in Mongo: a populate or individual assync requests? Example var mongoose = require('mongoose') , Schema = mongoose.Schema; var FeedPostCommentSc...
Ctesiphon asked 14/5, 2018 at 14:7

1

Solved

I have the following TypeScript code: const allDescribeBlocks: Array<ITestSuite> = suman.allDescribeBlocks; async.eachSeries(allDescribeBlocks, function (block: ITestSuite, cb: Function) { ...
Sublunary asked 11/6, 2017 at 1:45

3

Solved

Signature for async.map is map(arr, iterator, callback) (https://github.com/caolan/async#map) I have a var context //object and I need to pass this to the iterator. How do i do this ?
Trichinosis asked 2/1, 2014 at 12:22

2

Solved

Which is the fastest method gets the query to MYSQL, and then comes back to output: console.log('queries finished', results)" Is there an even better method? Please explain your answer! Thank...
Blench asked 6/1, 2017 at 19:41

3

In the following snippet I would like to validate the fields in the first async method. If they are not valid I would like to return an error to the user immediately. How do I do that? var for...
Bethina asked 29/9, 2017 at 14:46

1

Solved

I'm working on an AWS Lambda function that currently makes hundreds of API calls but when going into production it will make hundreds of thousands. The problem is that I can't test at that scale. ...
Kidron asked 4/8, 2017 at 18:25

5

Solved

As I have understood so far: Javascript is single threaded. If you defer the execution of some procedure, you just schedule it (queue it) to be run next time the thread is free. But Async.js define...

4

Solved

I need to do the code like following: function taskFirst(k, v) { console.log(k, v); } function taskSecond(k, v) { console.log(k, v); } function run() { var g1 = "Something"; var g2 = "Someth...
Prithee asked 22/1, 2014 at 16:7

6

Solved

I'm sure this is a fairly simple task, but I'm not able to wrap my head around it at this time. I've got a nested set of forEach loops, and I need to have a callback for when all the loops are done...
Rehnberg asked 27/3, 2017 at 16:43

1

Solved

I am having a slight issue when using async.queue with a filestream I have a scenario where my filestream will finish I set fileRead to true however the queue will be empty and already have call...
Aperiodic asked 9/2, 2017 at 19:46

1

Solved

Can someone explain me the different between this two: async.each(items, function (item, callback) { // Do something }); OR : items.forEach(function(item) { // Do something )};
Witha asked 31/1, 2017 at 9:59

1

I'm trying to parse and insert a big csv file into MongoDB but when the file extends 100'000 rows I get a bad response from the server. And the files I need to insert are usually above 200'000 rows...
Woodwind asked 25/1, 2017 at 17:36

2

I am trying to run an asynchronous loop async.each over an array of objects. On each object in the array, I am trying to run two functions sequentially (using promises). The problem is that async....
Vatican asked 10/1, 2017 at 11:8

1

Solved

I have been working with async.waterfall and nodejs. Its working very well but now I have a question about flow. I want to use a simple if condition in async.waterfall flow. async.waterfall([ ...
Jacobian asked 28/12, 2016 at 14:21

1

I need to perform a cyclic call to some external API with some delay, to prevent from 'User Rate Limit Exceeded' restriction. Google Maps Geocoding API is sensitive to 'req/sec', allowing 10 req/s...
Tessi asked 19/4, 2016 at 22:40

3

I started working on a node project recently and have been using the async library a lot. I'm kind of confused as to which option will be faster. Using async.map on some data and getting its result...
Byrnie asked 14/5, 2015 at 0:40

1

Solved

I keep getting an ETIMEDOUT or ECONNRESET error followed by a Callback was already called error when I run index.js. At first I thought it was because I was not including return prior to calling t...
Deform asked 23/10, 2015 at 19:30

© 2022 - 2024 — McMap. All rights reserved.