Skip to main content

All Questions

-1 votes
0 answers
68 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
80 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
  • 11
-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
32 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
56 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
105 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
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,481
2 votes
2 answers
111 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
2 votes
1 answer
50 views

I have no idea why setTimeout wrapping promise not working as i expected

I have this code. const testArray = [1, 2, 3, 4, 5]; const test = async () => { return Promise.resolve().then(() => { console.log("Testing console log: ", new Date()); }); };...
Jaeho Lee's user avatar
  • 513
1 vote
1 answer
56 views

populate my throw object with error message in json response

I want to populate my error object {'status': response.status, 'msg': ''} with the error message present in the JSON Response of the API if there is any, otherwise throw the error object without any ...
kajezevu's user avatar
-1 votes
1 answer
50 views

JavaScript Promise handlers schedule behaviour

Given this Promise chain. function getData() { return new Promise((resolve) => { // ... }) .then((data) => data.someData) .then((rawData) => processData(rawData)) .catch((...
kekerinho's user avatar

15 30 50 per page
1
2 3 4 5
284