All Questions
6,642
questions
-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 ...
-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 ...
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 (...
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 ...
-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, ...
-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(...
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....
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: {
...
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 ...
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 ...
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 ...
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 */);
...
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 ...
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....
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 ...