DEV Community

Discussion on: Creating Observables from an array of sequentially completing Promises

Collapse
 
_builtbyjay profile image
Jay Vincent

Thanks John. That's interesting - how many requests in total were you making?

Collapse
 
jwp profile image
John Peters • Edited

We are developing a program that get's an api endpoint which returns a large array of IDs for already finished jobs. But to get further job information, we currently have to send the get requests one at a time. We were finding that doing this without a delay, the browser would run out of memory in as little as 500 get requests, if I sent them all at once. The pipe with the delay did the trick. The total number of get requests in our tests so far is showing over 1700; but it's possible over time this could go much higher. Clearly this is a design point problem.

We will put in better query-ability on the back end starting next week. For example "Get all jobs of job type and date-range", "Get all failed jobs by date range" etc. And probably most important, we'll implement paging logic on back end. We know that nobody needs more data than they can read one page at a time.