Martin Nilsson (Coppermist) @ Pike (-) developers forum wrote:
Specifically for the case with multiple blocking dependencies I would like to see an API like
Concurrent.Promise all = Concurrent.Promise();
all->depend( db->promise_query("SELECT foo") ); all->depend( db->promise_query("SELECT bar") );
all->then(do_ok, do_fail);
Ask and your wishes might be granted ;-).
Just checked into Pike 8.1: depend(), fold() and fold_finish().
The last two have been done with testing yet. The code has been sped up, and will scale now (possibly memory neutral compared to the old, but speed-wise it now is O(1), instead of O(n^2)).