getify / fasy

FP iterators that are both eager and asynchronous
MIT License
543 stars 18 forks source link

Add limits for "concurrent" #8

Closed getify closed 5 years ago

getify commented 5 years ago

Provide a way to chunk concurrent request sets, say limited to maximum of 5 at a time, or whatever. Basically, serial is "concurrent with a limit of 1".

I'm thinking something like:

FA.concurrent(5).map(getFile,filenames);

This would limit to no more than five pending getFile(..) calls at once.