Reputation: 680
I have a set of functions that are independent of each other [each of them returns a value, each of these functions also accept parameters.] and I wish to run them in parallel. If i use async.parallel I wont have the liberty to catch the values. Is there a way to do this?
Thanks.
Upvotes: 1
Views: 861
Reputation: 11438
Example of how to do this in CoffeeScript:
async = require "async"
fns = [
(cb) -> cb 1
(cb) -> cb 2
(cb) -> cb 4
]
async.parallel fns, (results) ->
console.log results
# produces [1,2,4]
Upvotes: 1