Skip to content

Commit

Permalink
Unify the go exit entry.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shylock-Hg committed May 27, 2020
1 parent 4f0c557 commit fbe28b7
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/graph/GoExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,24 +576,27 @@ void GoExecutor::stepOut() {
std::move(future).via(runner).thenValue(cb).thenError(error);
}

#define GO_EXIT() \
do { \
if (records_.empty()) { \
onEmptyInputs(); \
return; \
} else { \
maybeFinishExecution(); \
return; \
} \
} while (0);

void GoExecutor::onStepOutResponse(RpcResponse &&rpcResp) {
joinResp(std::move(rpcResp));

if (isFinalStep()) {
maybeFinishExecution();
return;
GO_EXIT();
} else {
auto dsts = getDstIdsFromResps(records_.end() - 1, records_.end());
starts_ = std::move(dsts);
if (starts_.empty()) {
if (curStep_ < recordFrom_) {
onEmptyInputs();
return;
} else {
maybeFinishExecution();
return;
}
GO_EXIT();
}
curStep_++;
stepOut();
Expand Down

0 comments on commit fbe28b7

Please sign in to comment.