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
commit7ef44660181b5c9743475ea73bc2e87a5f1d318f (patch)
tree79986e03e6147aeecdfa405e238ceb6143294257 /src/libstore/build/goal.hh
parenta9f2aab22612bea940aa79cfb2eb15cc650ff869 (diff)
libstore: have goals promise WorkResults, not void
Change-Id: Idd218ec1572eda84dc47accc0dcd8a954d36f098
Diffstat (limited to 'src/libstore/build/goal.hh')
-rw-r--r--src/libstore/build/goal.hh12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libstore/build/goal.hh b/src/libstore/build/goal.hh
index 10926fffc..fbcbbcffc 100644
--- a/src/libstore/build/goal.hh
+++ b/src/libstore/build/goal.hh
@@ -92,8 +92,10 @@ struct Goal
*/
BuildResult buildResult;
+ struct WorkResult;
+
// for use by Worker and Goal only. will go away once work() is a promise.
- kj::Own<kj::PromiseFulfiller<void>> notify;
+ kj::Own<kj::PromiseFulfiller<Result<WorkResult>>> notify;
protected:
AsyncSemaphore::Token slotToken;
@@ -112,13 +114,15 @@ public:
protected:
kj::Promise<void> waitForAWhile();
kj::Promise<Result<void>>
- waitForGoals(kj::Array<std::pair<GoalPtr, kj::Promise<void>>> dependencies) noexcept;
+ waitForGoals(kj::Array<std::pair<GoalPtr, kj::Promise<Result<WorkResult>>>> dependencies) noexcept;
template<std::derived_from<Goal>... G>
kj::Promise<Result<void>>
- waitForGoals(std::pair<std::shared_ptr<G>, kj::Promise<void>>... goals) noexcept
+ waitForGoals(std::pair<std::shared_ptr<G>, kj::Promise<Result<WorkResult>>>... goals) noexcept
{
- return waitForGoals(kj::arrOf<std::pair<GoalPtr, kj::Promise<void>>>(std::move(goals)...));
+ return waitForGoals(
+ kj::arrOf<std::pair<GoalPtr, kj::Promise<Result<WorkResult>>>>(std::move(goals)...)
+ );
}
virtual kj::Promise<Result<WorkResult>> workImpl() noexcept = 0;