3
3
3042018-02-09 13:39:18
JavaScript
304, 2018-02-09 13:39:18

What is the best way to send data at intervals?

An array with data comes from the front (about 100-200 username values).
Then, using this array, I make a request to Mongo.
Monga gives a new array (of user id).
I then need to send a request to the public api.
The public api does not allow you to send an array at once, but only one value per request.
It also has a limit of 30 requests per second.
From the ideas so far, split the input array into several 30 elements each, and send them in a loop through settimeout per second
.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
marataziat, 2018-02-09
@304

Queues.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question