Martin Nilsson (Coppermist) @ Pike (-) developers forum wrote:
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.
It allows for the standard Promise interface which allows you to chain everything.
I.e. in practice, you expect the following to be possible:
Concurrent.Promise()->depend(future1)->depend(future2)->on_success(...);
Also I would like to make this possible:
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(...);
My proposed change above easily supports this. I'll look into it now.