Skip to content

Make Goal code use abstractions over interations with Worker #12697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 21, 2025

Conversation

Ericson2314
Copy link
Member

Motivation

I didn't write this, @L-as did. I just rebased it.

Instead of calling worker.waitForAWhile(shared_from_this()) etc., the subclasses of Goal instead call protected functions defined in Goal that abstract over these.

The code for awaiting has also been heavily simplified. Instead of calling addWaitee, then suspending,
co_await await(waitees) is called once, which also handles the suspend.

The end-goal is to remove all manual co_await Suspend{}s.

Context

It's the first commit of #12668. I am pulling commits from there and my #12663 in "order of least controversy". The overall goal is #12628.


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

Instead of calling `worker.waitForAWhile(shared_from_this())` etc.,
the subclasses of Goal instead call protected functions defined in Goal
that abstract over these.

The code for awaiting has also been heavily simplified.
Instead of calling `addWaitee`, then suspending,
`co_await await(waitees)` is called once, which also handles the suspend.

The end-goal is to remove all manual `co_await Suspend{}`s.
Copy link
Member Author

@Ericson2314 Ericson2314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good

@L-as
Copy link
Member

L-as commented Mar 20, 2025

LGTM

@Mic92
Copy link
Member

Mic92 commented Mar 21, 2025

@mergify queue

Copy link
Contributor

mergify bot commented Mar 21, 2025

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at f0b7b37

mergify bot added a commit that referenced this pull request Mar 21, 2025
@mergify mergify bot merged commit f0b7b37 into master Mar 21, 2025
26 checks passed
@mergify mergify bot deleted the worker-abstraction branch March 21, 2025 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants