Skip to content

feat(iroh): add Endpoint::closed and document watcher behavior#3943

Merged
ramfox merged 2 commits intoFrando/dropped-endpointfrom
Frando/endpoint-closed
Feb 13, 2026
Merged

feat(iroh): add Endpoint::closed and document watcher behavior#3943
ramfox merged 2 commits intoFrando/dropped-endpointfrom
Frando/endpoint-closed

Conversation

@Frando
Copy link
Copy Markdown
Member

@Frando Frando commented Feb 13, 2026

Description

Based on #3941 which is based on #3879

  • Add Endpoint::closed, which returns a CancellationToken that is cancelled once the endpoint is closing
  • Document watcher behavior with regards to closing the endpoint
  • Fix test

Breaking Changes

Notes & open questions

  • Instead of returning a CancellationToken we could make this an async fn, however to me it looks quite useful to get a CancellationToken and be able to use tokio::spawn(endpoint_closed.run_until_cancelled_owned(async move { .. })))
  • The cancellation token is cancelled when Endpoint::close starts, not when it ends. I wasn't sure what expected behavior is here. I opted for start because this guarantees that the endpoint is fully usable until then.

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.
    • List all breaking changes in the above "Breaking Changes" section.
    • Open an issue or PR on any number0 repos that are affected by this breaking change. Give guidance on how the updates should be handled or do the actual updates themselves. The major ones are:

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 13, 2026

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

Last updated: 2026-02-13T12:18:34Z

@Frando Frando force-pushed the Frando/endpoint-closed branch from 7405a6e to cfa01dd Compare February 13, 2026 12:16
@Frando Frando marked this pull request as ready for review February 13, 2026 12:18
@n0bot n0bot bot added this to iroh Feb 13, 2026
@github-project-automation github-project-automation bot moved this to 🚑 Needs Triage in iroh Feb 13, 2026
@Frando Frando changed the title feat: add Endpoint::closed and document watcher behavior feat(iroh): add Endpoint::closed and document watcher behavior Feb 13, 2026
@ramfox ramfox merged commit bb00b02 into Frando/dropped-endpoint Feb 13, 2026
46 of 53 checks passed
@ramfox ramfox deleted the Frando/endpoint-closed branch February 13, 2026 23:57
@github-project-automation github-project-automation bot moved this from 🚑 Needs Triage to ✅ Done in iroh Feb 13, 2026
@Frando Frando restored the Frando/endpoint-closed branch February 16, 2026 10:46
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