-
Notifications
You must be signed in to change notification settings - Fork 165
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 unneeded async interactions with the magicsock actor #2058
Conversation
iroh/src/node.rs
Outdated
self, | ||
req: NodeConnectionInfoRequest, | ||
) -> RpcResult<NodeConnectionInfoResponse> { | ||
) -> impl Future<Output = RpcResult<NodeConnectionInfoResponse>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the change from async
to impl Future
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because otherwise clippy says Warning: unused 'async' for function with no await statements
. Also maybe it makes it obvious that there is no await. Can also add a clippy allow, if preferred? Don't mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it to return std::future::Ready
directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer clippy allow, with a comment why it is an async
function, to avoid confusion when reading the code later
Cargo.lock
Outdated
@@ -2429,6 +2429,7 @@ dependencies = [ | |||
"bytes", | |||
"clap", | |||
"criterion", | |||
"crypto_box", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this changing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe current main has this wrong after #2053
Description
While working on #2056 I spotted that we use the actor inbox with return channels for information that is readily available already on the shared inner magicsock. This removes the unneeded complexity and thus simplifies
get_mapping_addr
,endpoint_info
andendpoint_infos
to return the information non-async and infallible. Yay!Notes & open questions
Change checklist