Skip to content

Commit

Permalink
Move remaining GuestWork functionality into Downstairs (#1510)
Browse files Browse the repository at this point in the history
The `struct GuestWork` object has slowly been shrinking over the course
of various PRs (e.g. #1482 and #1502).

At this point, the only thing it does is track un-acked and
recently-acked jobs. It doesn't actually do anything in relation to the
`GuestIOHandle` or `Guest`!

The acked-ness of a job is a property of its `DownstairsIO` object,
which is otherwise stored and managed in the `struct Downstairs`. As
such, we spend a bunch of LOC passing a `&mut GuestWork` into the
`Downstairs` whenever we're doing things with jobs.

This PR moves the remaining functionality of the `GuestWork` into the
`Downstairs` proper:

- `GuestWork::active` becomes `Downstairs::gw_active` (unacked jobs)
- `GuestWork::complete` becomes `Downstairs::acked_ids` (ringbuf of
  recently-acked job IDs)
- The pre-existing `Downstairs::complete/complete_jobs` are renamed to
  `Downstairs::retired_ids/retired_jobs`, for clarity
  • Loading branch information
mkeeter authored Oct 17, 2024
1 parent 0875da3 commit fb3d8d1
Show file tree
Hide file tree
Showing 3 changed files with 195 additions and 347 deletions.
Loading

0 comments on commit fb3d8d1

Please sign in to comment.