Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
-1 votes
0 answers
76 views

Promise.All() executing but resolving Promises immediately without waiting for responses

I am trying to execute some tasks in parallel (literally, spread over multiple threads and CPU cores) via firing them off using Promise.All(), which then calls a function that sets them off to work ...
GFORCE100's user avatar
-3 votes
0 answers
81 views

Does this specific pattern synchronize the specified awaited asynchronous calls? [duplicate]

Does this specific pattern synchronize the specified part of this function? Synchronization can be implemented variously; however, I would like to know if this specific pattern accomplishes ...
stackhatter's user avatar
0 votes
2 answers
81 views

Calling .then within a new Promise() javascript [duplicate]

I've learned javascript async/await before learning promise.then() syntax, and I am now attempting to go back and learn promise.then(). I currently have the following code let getDatabaseData = async (...
JackG's user avatar
  • 13
0 votes
1 answer
41 views

promise.all with loop still get pending in node.js

This app function is about uploading multiple images, the image upload API can only upload one image each time. when uploading multiple images, trying to loop over the images and sequentially upload ...
user824624's user avatar
  • 7,755
-1 votes
1 answer
39 views

how to collect returned results of promises

as shown in the below posted code, for the array geoTIFFsFileNames it contains five files' names. for the number of items in the latter array, i want to invoke the webservice WSGeoTIFFAsBlobStreamer, ...
Amr's user avatar
  • 33
-2 votes
1 answer
39 views

await does not suspend the execution till it finishes [closed]

for the below posted code, despite i am using await before Promise.all, the execution of the code does not wait till await Promise.all finishes first. what happens is, the code that contains: .then(...
Amr's user avatar
  • 33
0 votes
0 answers
26 views

Can I use promises to speed up a computational process so that I can create parallelism in it? [duplicate]

I have intense CPU consuming computations that need to be done and then written to file. I know that I can use promises to create parallelism in writing and reading files, since it is an I/O operation....
Meric Gunduz's user avatar
0 votes
2 answers
33 views

How to return data in SOAP from Promise

I created a SOAP server in Node.js const soap = require('soap'); const http = require('http'); const XMLWriter = require('xml-writer'); const service = { ImpDispatcherService: { ...
Wernfried Domscheit's user avatar
1 vote
1 answer
63 views

Turn not awaited unhandled erroneous promise into warning @ processTicksAndRejections (created by throw error in "then")

there is no await on top-level allowed and my expectation was that the error thrown below would be logged as warning only but it turns out to be a blocker for completion, i.e. upon statement await ...
CSeitel's user avatar
  • 53
0 votes
3 answers
107 views

javascript MySQL - using Promise-await-async constructs, can't get code to wait for query completion

I've tried multiple versions of example code but can never seem to get something that guarantees completion of the query set before other code commences. I was under the impression that 'await' makes ...
user55836's user avatar
0 votes
0 answers
30 views

NodeJS - Best Practice to process a huge text file and for each row, fire off an API requests, and write an output file (See Example Below)

I am new to concept of "promises" and seeking an enterprise grade or best practice to process a huge text file (1GB max) in NodeJS and then use each row to fire off an API request. The goal ...
Anx's user avatar
  • 13
0 votes
1 answer
31 views

How/why does Mocha suppress unhandled promise rejections, and how can I prevent it from doing this?

Node.js's default behaviour when a promise rejection is unhandled is to terminate the process. node:internal/process/promises:288 triggerUncaughtException(err, true /* fromPromise */); ...
s100's user avatar
  • 21
1 vote
1 answer
52 views

Node js promise all multiple api calls in loop

I'm new to Node js. Here I'm calling multiple api calls in Async. But I want to return promise once all calls are finished. function getChunkBatchDetailsResponse$(id, baseUri, ) { return new ...
vijred's user avatar
  • 31
1 vote
3 answers
74 views

Why do we get an uncaught error, when a promise is rejected before the rejection handler is locked in?

I am trying to catch the rejection reason of an already rejected promise, but I am getting an uncaught error. I have spent some time studying promises, but still do not understand why the error occurs....
Magnus's user avatar
  • 7,471
2 votes
2 answers
120 views

Do callbacks from I/O operations that return promises go to the I/O queue or the microtask queue in Node?

I'm just learning the details of how the event loop in Node works. I learned that the promise queue takes priority over the timer queue, which takes priority over the I/O queue. async function ...
J Booth's user avatar
  • 21

15 30 50 per page
1
2 3 4 5
443