Is there an idiomatic way to limit the number of aff fibers running for a particular task?
For context, I’m writing some code to backup a podcast from an rss feed (just for my own education), and to download them I’m doing something like this.
downloadAll = do rss <- getFeed rss.items # parTraverse_ downloadItem
This starts an http request immediately for each item, which seems unfriendly to the server.
Is there an idiomatic way to queue the
Affs so that only
n of them are running at any one time?
Right now I’m futzing around with storing a queue in an AVar, but I have no idea what I’m doing and it feels like something there might just be a library method for?