Stephen R. van den Berg wrote:
Martin Nilsson (Coppermist) @ Pike (-) developers forum wrote:
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(...);
The changes are in. Including testsuite entries.
The interface is slightly different from what you proposed:
Promise p = Promise(); call_out(666, lambda(Promise q) { q->success(1); }, p->depend()); call_out(123, lambda(Promise q) { q->success(1); }, p->depend()); call_out(42, lambda(Promise q) { q->success(1); }, p->depend()); p->on_success(...);
But I think it fits your needs as is.