Skip to content
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

Decompose answer struct. #495

Merged
merged 4 commits into from
Apr 1, 2023
Merged

Decompose answer struct. #495

merged 4 commits into from
Apr 1, 2023

Conversation

zenhack
Copy link
Contributor

@zenhack zenhack commented Apr 1, 2023

This splits the answer struct in the rpc package into ansent and ansReturner, which makes it more similar to e.g. impent/importClient. This should make this generally easier to understand and work with.

Along the way I spotted a place where we were violating a documented invariant, and fixed it (9161f0e). Otherwise there is no functional change.

zenhack added 4 commits March 31, 2023 20:32
...based on whether or not we need to access the field through c.lk.
We never actually invoke it directly from ansReturner.
The comments for msgReleaser suggest we can't hold the lock while doing
this, so add it to the releaseList instead. I'd like to make this harder
to mess up in the future.
This is obsolete, now that we have to go through c.lk to get to the
entry.

This patch also drops all of the parameters that were transitively
passed to assertIs().

We do still sometimes want to actually *use* the connection though,
so we add a method to ansent to fetch it, which localizes the cast.
@zenhack zenhack merged commit d5231d3 into capnproto:main Apr 1, 2023
@zenhack zenhack deleted the ansReturner branch April 1, 2023 01:07
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.

2 participants