Skip to content

feat: use watchable instead of callbacks for netmon changes#25

Merged
dignifiedquire merged 4 commits into
mainfrom
feat-watcher
May 23, 2025
Merged

feat: use watchable instead of callbacks for netmon changes#25
dignifiedquire merged 4 commits into
mainfrom
feat-watcher

Conversation

@dignifiedquire

Copy link
Copy Markdown
Contributor

Description

Breaking Changes

Notes & open questions

Change checklist

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

@github-actions

github-actions Bot commented May 15, 2025

Copy link
Copy Markdown

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/net-tools/pr/25/docs/net_tools/

Last updated: 2025-05-23T11:34:29Z

@flub flub left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice!

Comment thread netwatch/src/netmon.rs Outdated
.await?;
r.await?;
Ok(())
pub fn subscribe(&self) -> n0_watcher::Direct<State> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Small nit, .subscribe().get() is a bit odd. But I don't mind.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggestion: We use e.g. local_addrs_watch or just the name of what it is, e.g. node_addr or conn_type elsewhere. So perhaps we could use interface_state() -> n0_watcher::Direct<State> here? Or watch_interface_state()? Or if_state_watcher()? or sth like that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

changed to interface_state

@n0bot n0bot Bot added this to iroh May 15, 2025
@github-project-automation github-project-automation Bot moved this to 🏗 In progress in iroh May 15, 2025
@dignifiedquire dignifiedquire merged commit dd02701 into main May 23, 2025
25 of 27 checks passed
@github-project-automation github-project-automation Bot moved this from 🏗 In progress to ✅ Done in iroh May 23, 2025
@dignifiedquire dignifiedquire deleted the feat-watcher branch May 23, 2025 11:37
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.

3 participants