docs(iroh): clarify ProtocolHandler::accept#3567
Merged
dignifiedquire merged 2 commits inton0-computer:mainfrom Nov 3, 2025
Merged
docs(iroh): clarify ProtocolHandler::accept#3567dignifiedquire merged 2 commits inton0-computer:mainfrom
dignifiedquire merged 2 commits inton0-computer:mainfrom
Conversation
iroh/src/protocol.rs
Outdated
| /// The returned future runs on a freshly spawned tokio task so it can be long-running. | ||
| /// The returned future runs on a freshly spawned tokio task so it can be long-running. Once | ||
| /// `accept()` returns, the connection is closed, so the returned future is expected | ||
| /// to drive the protocol to completion. If there in a protocol error, you can |
Member
There was a problem hiding this comment.
It should also clarify that the connection is only closed if no other clones exist, not alwayy when accept returns. I.e. if you send the connection or a clone to another task via a channel and return from accept, the connection will stay alive until closed explicitly by user code with Connection::close or until the last clone of Connection is dropped.
Contributor
Author
There was a problem hiding this comment.
Good comment, thanks. I just force-pushed a new version that does a better job with this
Clarify at the connection is always dropped when `accept` returns, and that the AcceptError variant doesn't really matter
33b7033 to
2a65d09
Compare
dignifiedquire
approved these changes
Nov 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clarify at the connection is always closed when
acceptreturns, and that the AcceptError variant doesn't really matter