client Add Operation::wait()

This commit is contained in:
Michael Davidsaver
2020-03-11 11:41:22 -07:00
parent 92228556d7
commit 25e712eb2a
6 changed files with 184 additions and 17 deletions
+9 -1
View File
@@ -174,7 +174,15 @@ std::shared_ptr<Operation> GetBuilder::_exec_info()
auto chan = Channel::build(ctx, _name);
auto op = std::make_shared<InfoOp>(chan);
op->done = std::move(_result);
if(_result) {
op->done = std::move(_result);
} else {
auto waiter = op->waiter = std::make_shared<ResultWaiter>();
op->done = [waiter](Result&& result) {
waiter->complete(std::move(result), false);
};
}
chan->pending.push_back(op);
chan->createOperations();