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(iroh, iroh-relay): JoinSet disabling in tokio::select! #3052

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

flub
Copy link
Contributor

@flub flub commented Dec 16, 2024

Description

This changes the disabling of JoinSet::join_next branches in
tokio::select! calls to rely on pattern matching alone. This changes
nothing to the logic executing in the select! call, but often results
in less code.

A branch is disabled if the pattern does not match, and the remaining
futures are still awaited. Once the branch is disabled the logic of
tokio::select! is exactly the same regardless of whether it was
disabled because of an if condition or because of a mismatched pattern.

Breaking Changes

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.

This changes the disabling of JoinSet::join_next branches in
tokio::select! calls to rely on pattern matching alone.  This changes
nothing to the logic executing in the select! call, but often results
in less code.

A branch is disabled if the pattern does not match, and the remaining
futures are still awaited.  Once the branch is disabled the logic of
tokio::select! is exactly the same regardless of whether it was
disabled because of an if condition or because of a mismatched pattern.
Copy link

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/3052/docs/iroh/

Last updated: 2024-12-16T11:34:34Z

Copy link

Netsim report & logs for this PR have been generated and is available at: LOGS
This report will remain available for 3 days.

Last updated for commit: ccd4215

@flub flub requested a review from dignifiedquire December 16, 2024 11:38
@flub flub added this pull request to the merge queue Dec 16, 2024
@dignifiedquire dignifiedquire added this to the v0.30.0 milestone Dec 16, 2024
Merged via the queue into main with commit a6f502c Dec 16, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants