Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

remove OpenedStream and ClosedStream from Notifiee interface #250

Merged
merged 2 commits into from
May 24, 2022

Conversation

marten-seemann
Copy link
Contributor

As far as I can tell, nobody is using the OpenedStream and ClosedStream notification.

This is because they're not really useful: You can get a notification that the swarm opened a new stream, but you can read, write, close or reset the stream without interfering with the application. Therefore you won't even know which libp2p protocol is being negotiated on that stream.

@github-actions
Copy link

gocompat says:

branch 'master' set up to track 'origin/master'.
"github.com/libp2p/go-libp2p-core/network".NotifyBundle.OpenedStreamF FieldDeleted
"github.com/libp2p/go-libp2p-core/network".NotifyBundle.ClosedStreamF FieldDeleted
"github.com/libp2p/go-libp2p-core/network".NotifyBundle.OpenedStream MethodDeleted
"github.com/libp2p/go-libp2p-core/network".NotifyBundle.ClosedStream MethodDeleted
"github.com/libp2p/go-libp2p-core/network".NoopNotifiee.OpenedStream MethodDeleted
"github.com/libp2p/go-libp2p-core/network".NoopNotifiee.ClosedStream MethodDeleted
"github.com/libp2p/go-libp2p-core/network".Notifiee InterfaceChanged

Copy link
Contributor

@vyzo vyzo left a comment

Choose a reason for hiding this comment

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

fine by me.

@Stebalien anyone using this?

@Stebalien
Copy link
Member

We ahve some tests inside bitswap, but that's it. It looks like elrond may have been using this for some form of connection management, but really the hook isn't all that useful.

I'd remove it and figure out a way to fix upstream.

@marten-seemann marten-seemann merged commit 13e0150 into master May 24, 2022
@marten-seemann marten-seemann deleted the slim-notifiee branch May 24, 2022 15:15
dennis-tra added a commit to libp2p/punchr that referenced this pull request Jun 14, 2022
dennis-tra added a commit to libp2p/punchr that referenced this pull request Jun 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants