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-net)!: remove async channel #2620

Merged
merged 8 commits into from
Aug 14, 2024

Conversation

rklaehn
Copy link
Contributor

@rklaehn rklaehn commented Aug 13, 2024

Description

Removes async-channel from iroh-net and replaces it with the tokio mpsc channel.

This is a mergeable version of #2614

Breaking Changes

LocalSwarmDiscovery is no longer UnwindSafe

Notes & open questions

Open question: I am using blocking_send from inside the windows RouteMonitor. This depends on that the callback thread is not a tokio thread. I have no idea if this is a reasonable assumption to make. Otherwise we would have to bring back the runtime check condition or just capture a runtime handle and spawn a task.

Note: what even is this? The only message there is is NetworkMessage::Change, and there is no timestamp or anything. So could I just use try_send? If the queue is full, there is already a Change in it, so it is as good as the new one...

Change checklist

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

Copy link

github-actions bot commented Aug 13, 2024

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

Last updated: 2024-08-14T06:29:46Z

@rklaehn rklaehn changed the title Remove async channel from iroh net refactor(iroh-net)!: remove async channel Aug 13, 2024
@rklaehn rklaehn marked this pull request as ready for review August 13, 2024 12:05
@@ -127,7 +130,7 @@ harness = false
duct = "0.13.6"

[features]
default = ["metrics"]
default = ["metrics", "local_swarm_discovery", "iroh-relay"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only added this for testing, please undo

# Conflicts:
#	iroh-net/src/discovery/local_swarm_discovery.rs
@rklaehn rklaehn force-pushed the remove-async-channel-from-iroh-net branch from fc2f7f6 to 3eef78a Compare August 14, 2024 06:29
@rklaehn rklaehn enabled auto-merge August 14, 2024 06:32
@rklaehn rklaehn added this pull request to the merge queue Aug 14, 2024
Merged via the queue into main with commit 74a527b Aug 14, 2024
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants