I need to run many http requests in parallel, but limit number of cuncurrent requests to require("os").cpus().length (P.S. it doesn’t make sense, node is one threaded, number should be custom)
I usually just do this ad-hoc, but I suppose it should be in some sort of aff-utils like library. This will work for any Traversable, by using an AVar as a lock/queue.
It probably warrants some additional exception safety, but it gets the job done.