title: Dynamic async parallel task
body: <p>Context:</p>
  
  <p>I fetched some "users". I want to know more about these specific users before returning the response, so I fetch detailed info for all users and add that to a result...then I return the result after all requests have finished. I'm having trouble using the <code>parallel</code> call:</p>
  
  <pre><code>async = require 'async'
  
  # Assume I don't know how many users are here. Test data.
  users = [
      name: 'user1'
    ,
      name: 'user2'
  ]
  
  # Fake add some extra data to the user.
  fetchUser = (name, cb) -&gt;
  
    setTimeout (-&gt;
      user = 
        name: name
        email: name + '@email.com'
      cb user
    ), 1 * 1000
  
  
  fetchUsers: (userList, cb) -&gt;
  
    result = 
      count: userList.length 
      users: []
  
    # runInParallel = []
    # for user in userList
    #   fetchUsers(user.name) # Yea, not going to work either.
    #
    # async.parallel runInParallel
  
    async.parallel [
      fetchUser('user1') # Yea, how do I build an array of a function?
      fetchUser('user2')
    ], (err, user) -&gt;
      #console.log 'returned user ' + user.name # If this calls back once, then this won't work....
      if !err
        result.users.push user
  
      cb result
  
  # Do it.
  fetchUsers users, (result) -&gt;
    console.log result
  </code></pre>