AnsweredAssumed Answered

dojo.promiseAll with limit to process * promises at once

Question asked by sandhyabaratam@gmail.com on Mar 9, 2020
Latest reply on Mar 10, 2020 by sandhyabaratam@gmail.com

Hi, I have a custom widget, which takes a csv file and updates it back with results from hosted layer. for example I have a 80k file, for which I should get the out fields by executing query from a hosted layer. 

1.when I use promiseAll with all 80k queryTask results in collection, it is getting stuck.

2.if I use layer.queryfeatures() one after other,too many requestes hitting the server and getting timeouts. Is there any way to limit the promises count to be taken at once? even if I had 80k promises in collection, if i can instruct system to take only 10 requests at a time that will solve my problem.

3.I have tried "reduce" to sequence the promises, even then once it hit layer.queryfeatures it is going asynchronous.

I am looking for some thing like async.eachLimit. can some one please help?

Outcomes