I am trying to make potentially dozens of ajax calls and want to stack them out 4 or 5 concurrently but not fire them all at once. In C# I would use an ActionBlock, and send in my delegate until I'm ready and then start executing.
so, I am attempting to build the same in JavaScript, and have been able to get everything working using $.when and arrays, but I am not able to pass in a delegate to a function with particular parameters.
I have tried fn.apply and fn.bind, but both of them execute immediately while trying to create the execution chain.
In c#, the signature would simply be :
public Push(Action|Func<T> methodToCall){...}
Then I would invoke it recursively in the .then handler of the $.when