Funny, I've been looking at Oni (
http://www.croczilla.com/oni) which
is inspired by Orc
I found myself wanting something like 'Par' (
http://www.croczilla.com/
oni/reference/#par-fork-join-parallel-execution), when adding numbers
returned asynchronously. The sum needs to be displayed only when
we've received (and added) all the numbers
I ended up with:
var x = getWebServiceObjectE(oneE(request));
var y = getWebServiceObjectE(oneE(request));
mergeE(x,y).collectE(0,function(elt,sum) { return sum + Number
(elt); })
.skipFirstE()
.mapE(function(msg){ alert(msg); });
I used skipFirstE to get notified only when both ajax calls have
completed, but that forces me to do the bookeeping...
I am sure there's a nicer way to do this...