Stephen R. van den Berg wrote:
On second thought, the better interface probably would be:
Concurrent.Promise p = Concurrent.Promise(); Concurrent.Future f;
f = p->depend( future1 ); f = f->depend( future2 ); f->on_success(...);
Wouldn't it?
I don't see what that gives you.
Also I would like to make this possible:
void depend(Future f); variant Future depend();
That allows you to very easily synchronize across multiple call back based APIs.
Promise p = Promise(); call_out(666, lambda(Future f) { f->success(1); }, p->depend()); call_out(123, lambda(Future f) { f->success(1); }, p->depend()); call_out(42, lambda(Future f) { f->success(1); }, p->depend()); p->on_success(...);