Skip to content

Conversation

@matheus23
Copy link
Member

Description

Implements two new functions for JoinSets in Wasm, mirroring the same functions on the tokio side, as well as one function on JoinError.

Change checklist

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

@matheus23 matheus23 requested a review from Frando January 5, 2026 15:12
@matheus23 matheus23 self-assigned this Jan 5, 2026
@github-actions
Copy link

github-actions bot commented Jan 5, 2026

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

Last updated: 2026-01-05T15:13:19Z

@matheus23 matheus23 merged commit 4ecea8f into main Jan 7, 2026
25 checks passed
@matheus23 matheus23 deleted the matheus23/poll-join-next branch January 7, 2026 11:25
github-merge-queue bot pushed a commit to n0-computer/iroh that referenced this pull request Jan 8, 2026
…rded_channel.rs` (#3681)

## Description

Depends on n0-computer/n0-future#23 for
`JoinSet::poll_join_next` and `JoinError::try_into_panic`.

- Removes `guarded_channel.rs`
- Instead, uses normal mpsc channels, and once it closes them, collects
all messages that were missed before the channel was closed, sends them
back to the `RemoteMap`, which will immediately spawn a new
`RemoteStateActor` in case it missed some messages during shutdown.
- Spawns the `RemoteStateActor` in a `JoinSet` that's held in a `Mutex`
inside the `RemoteMap` (effectively owned by the magic socket).

## Notes & open questions

I think it's good to look at this right now, but some
considerations/TODOs:
- I don't like the mutex around the JoinSet in `RemoteMap`. Maybe only
the `magicsock::Actor` should own the `JoinSet`, and the `RemoteMap`
shouldn't actually store it itself.
- I'm not sure if draining all "initial messages" in
`RemoteStateActor::run` is the right way to do this.


## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.

---------

Co-authored-by: Franz Heinzmann <frando@unbiskant.org>
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.

3 participants