I want to load and process files in parallel. My Problem is that the data processing in my subscription isn't run asynchrously, only the http fetch. How can I also make the data processing in parallel?
await Promise.all(requestsArray.map((request) => {
return new Promise((resolve, reject) => {
this.http.post(request, new FormData()).subscribe(async json => {
console.log('load data in parallel from API for ' + request);
mylongprocessingfunction(json); // blocks further processing of other files
resolve(json);
}, error => {
console.log(error)
reject({ error: error });
});
});
}));