caolan / nimble

A really tiny functional JavaScript and async flow-control library
http://caolan.github.com/nimble
MIT License
329 stars 27 forks source link

[Request] make ".parallel" to run N concurrent functions. #9

Open SimoneTaliercio opened 9 years ago

SimoneTaliercio commented 9 years ago

First of all, thanks a lot for Nimble! :)

I would like to suggest a feature: right now the "_.parallel" function definition is "Parallel will run a list of async functions ALL at the same time."

It would be awesome to have a simple mechanism (queue based ?) to specify how many functions to run in parallel instead of ALL.

For example, imagine what it will happen when each function triggers an HTTP request.

germantellezv commented 3 years ago

Sorry i don't know where to do a question but i'd like to know if nimble works with multiple workers ? If my machine has 2 processors it will use those?

caolan commented 3 years ago

Nimble will not convert single-threaded code into multi-threaded code. You might want to look at WebWorkers.