aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build/goal.hh
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-10-05 00:38:35 +0200
committereldritch horrors <pennae@lix.systems>2024-10-05 19:06:59 +0000
commita9f2aab22612bea940aa79cfb2eb15cc650ff869 (patch)
tree7506cc3267bb7a7cefccca6700d80d4047d86a4e /src/libstore/build/goal.hh
parent99edc2ae38b533ecd742c172a3531cc8958c4be5 (diff)
libstore: extract Worker::goalFinished specifics
there's no reason to have the worker set information on goals that the goals themselves return from their entry point. doing this in the goal `work()` function is much cleaner, and a prerequisite to removing more implicit strong shared references to goals that are currently running. Change-Id: Ibb3e953ab8482a6a21ce2ed659d5023a991e7923
Diffstat (limited to 'src/libstore/build/goal.hh')
-rw-r--r--src/libstore/build/goal.hh6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstore/build/goal.hh b/src/libstore/build/goal.hh
index 03c2cf309..10926fffc 100644
--- a/src/libstore/build/goal.hh
+++ b/src/libstore/build/goal.hh
@@ -92,7 +92,7 @@ struct Goal
*/
BuildResult buildResult;
- // for use by Worker only. will go away once work() is a promise.
+ // for use by Worker and Goal only. will go away once work() is a promise.
kj::Own<kj::PromiseFulfiller<void>> notify;
protected:
@@ -121,6 +121,8 @@ protected:
return waitForGoals(kj::arrOf<std::pair<GoalPtr, kj::Promise<void>>>(std::move(goals)...));
}
+ virtual kj::Promise<Result<WorkResult>> workImpl() noexcept = 0;
+
public:
/**
@@ -138,7 +140,7 @@ public:
trace("goal destroyed");
}
- virtual kj::Promise<Result<WorkResult>> work() noexcept = 0;
+ kj::Promise<Result<WorkResult>> work() noexcept;
virtual void waiteeDone(GoalPtr waitee) { }