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

refactor: use two stage accept #87

Merged
merged 2 commits into from
Jun 26, 2024
Merged

refactor: use two stage accept #87

merged 2 commits into from
Jun 26, 2024

Conversation

rklaehn
Copy link
Collaborator

@rklaehn rklaehn commented Jun 26, 2024

this is so each step of the accept process is cancel-safe

we might want to deprecate the combined fn.

Questions:

  • leave the combined one in? NO

  • should accept return a Result<impl Future...> or a Result<Accepting> where Accepting has a fn that resolves to a future?

  • returning a concrete type that implements Future itself is not possible without boxing, and I don't want to do this because we care about allocations for the mem path.

  • impl Future: works fine if you use it as is, but might be a pain if you want to pass it to a handler fn

  • concrete type: is slightly less verbose in direct use, but easier when passing to a handler fn

this is so each step of the accept process is cancel-safe

we might want to deprecate the combined fn.
@rklaehn rklaehn force-pushed the two-stage-accept branch 2 times, most recently from c4d76b8 to 6feb147 Compare June 26, 2024 12:53
also get rid of accept_and_read_first
@rklaehn rklaehn merged commit c2520b8 into main Jun 26, 2024
15 checks passed
@rklaehn rklaehn deleted the two-stage-accept branch June 26, 2024 13:15
github-merge-queue bot pushed a commit to n0-computer/iroh that referenced this pull request Jun 26, 2024
## Description

fix(iroh): use two stage accept from quic-rpc to make the accept process
cancel-safe

Needs n0-computer/quic-rpc#87

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] Documentation updates if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.

---------

Co-authored-by: dignifiedquire <[email protected]>
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.

1 participant