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

swarm: Rename NetworkBehaviourAction to ToSwarm #3123

Closed
thomaseizinger opened this issue Nov 15, 2022 · 6 comments · Fixed by #3658
Closed

swarm: Rename NetworkBehaviourAction to ToSwarm #3123

thomaseizinger opened this issue Nov 15, 2022 · 6 comments · Fixed by #3658
Labels
difficulty:easy getting-started Issues that can be tackled if you don't know the internals of libp2p very well help wanted priority:important The changes needed are critical for libp2p, or are blocking another project

Comments

@thomaseizinger
Copy link
Contributor

Description

Similar to #2854, what do people think of renaming NetworkBehaviourAction to ToSwarm?

Motivation

Consistent naming of messages between our "actors".

Current Implementation

The current naming is very inconsistent which makes things hard to understand.

Are you planning to do it yourself in a pull request?

Maybe.

@thomaseizinger thomaseizinger added priority:nicetohave decision-pending Marks issues where a decision is pending before we can move forward. labels Nov 15, 2022
@mxinden
Copy link
Member

mxinden commented Nov 15, 2022

I am in favor of a rename for the sake of consistency. I don't have a strong opinion on the name. ToSwarm sounds good to me.

@thomaseizinger
Copy link
Contributor Author

Hmm, I just realised that ToSwarm doesn't quite work because we also have a NotifyHandler variant in there.

@mxinden
Copy link
Member

mxinden commented Nov 16, 2022

Given that the NotifyHandler event is passed through the Swarm one could argue that ToSwarm is still a valid name.

@thomaseizinger
Copy link
Contributor Author

It even says in the documentation:

Instructs the Swarm to send an event to the handler dedicated to a connection with a peer.

@mxinden mxinden added priority:important The changes needed are critical for libp2p, or are blocking another project difficulty:moderate help wanted getting-started Issues that can be tackled if you don't know the internals of libp2p very well and removed priority:nicetohave decision-pending Marks issues where a decision is pending before we can move forward. labels Mar 13, 2023
@mxinden
Copy link
Member

mxinden commented Mar 13, 2023

Based on out-of-band discussion, updating labels here. Please comment in case you think this is not appropriate.

@thomaseizinger
Copy link
Contributor Author

If we end up succeeding with #3591, the 2nd type parameter will go away through that, thus, I don't think it is worth going into the direction of #3273 but instead do a simple rename with a type alias to retain backwards-compatibility.

Based on that, I think this is difficulty:easy.

@thomaseizinger thomaseizinger modified the milestone: v0.52.0 Mar 22, 2023
@mergify mergify bot closed this as completed in #3658 Mar 24, 2023
mergify bot pushed a commit that referenced this issue Mar 24, 2023
umgefahren pushed a commit to umgefahren/rust-libp2p that referenced this issue Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty:easy getting-started Issues that can be tackled if you don't know the internals of libp2p very well help wanted priority:important The changes needed are critical for libp2p, or are blocking another project
Projects
None yet
2 participants