Answer the question
In order to leave comments, you need to log in
How to bulk send requests from the browser?
Hello!
I work with the react + redux + redux-thunk + axios stack
There is a request, an object is sent in the request, the object has a key with an array of about 300000 in length. It is
necessary to split this array into parts (I plan through array.slice). And send 5k requests, a pack of 4 with a 3 second delay, so that the server has time to give answers.
Could you tell me how to implement this task correctly? Through a for loop with Promise.all?
Answer the question
In order to leave comments, you need to log in
Promise.all will run all requests at once. Google promise sequence, or you will find a library, or write it by hand.
Bursts are not as efficient as a "multi-threaded" queue with a constant number of concurrent tasks.
https://github.com/sindresorhus/p-map
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question