From 896a123605b825cd0a1548fc40da1a757ca30d25 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sat, 5 Oct 2024 00:38:35 +0200 Subject: libstore: remove Goal::StillAlive this was a triumph. i'm making a note here: huge success. it's hard to overstate my satisfaction! i'm not even angry. i'm being so sincere ri actually, no. we *are* angry. this was one dumbass odyssey. nobody has asked for this. but not doing it would have locked us into old, broken protocols forever or (possibly worse) forced us to write our own async framework building on the old did-you-mean-continuations in Worker. if we had done that we'd be locked into ever more, and ever more complex, manual state management all over the place. this just could not stand. Change-Id: I43a6de1035febff59d2eff83be9ad52af4659871 --- src/libstore/build/goal.hh | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'src/libstore/build/goal.hh') diff --git a/src/libstore/build/goal.hh b/src/libstore/build/goal.hh index 17c3d85db..03c2cf309 100644 --- a/src/libstore/build/goal.hh +++ b/src/libstore/build/goal.hh @@ -99,11 +99,7 @@ protected: AsyncSemaphore::Token slotToken; public: - - struct Finished; - - struct [[nodiscard]] StillAlive {}; - struct [[nodiscard]] Finished { + struct [[nodiscard]] WorkResult { ExitCode exitCode; BuildResult result; std::shared_ptr ex; @@ -113,21 +109,13 @@ public: bool checkMismatch = false; }; - struct [[nodiscard]] WorkResult : std::variant< - StillAlive, - Finished> - { - WorkResult() = delete; - using variant::variant; - }; - protected: - kj::Promise> waitForAWhile(); - kj::Promise> + kj::Promise waitForAWhile(); + kj::Promise> waitForGoals(kj::Array>> dependencies) noexcept; template... G> - kj::Promise> + kj::Promise> waitForGoals(std::pair, kj::Promise>... goals) noexcept { return waitForGoals(kj::arrOf>>(std::move(goals)...)); -- cgit v1.2.3