feat(swarm): deprecate ConnectionHandlerEvent::Close#4714
feat(swarm): deprecate ConnectionHandlerEvent::Close#4714thomaseizinger merged 4 commits intov0.52from
ConnectionHandlerEvent::Close#4714Conversation
|
@mxinden What is the procedure again for getting this into |
This PR implements the long-awaited design of disallowing `ConnectionHandler`s to close entire connections. Instead, users should close connections via `ToSwarm::CloseConnection` from a `NetworkBehaviour` or - even better - from the `Swarm` via `close_connection`. A `NetworkBehaviour` also does not have a "full" view onto how a connection is used but at least it can correlate whether it created the connection via the `ConnectionId`. In general, the more modular and friendly approach is to stop "using" a connection if a particular protocol no longer needs it. As a result of the keep-alive algorithm, such a connection is then closed automatically. Depends-on: #4745. Depends-on: #4718. Depends-on: #4749. Related: #3353. Related: #4714. Resolves: #3591. Pull-Request: #4755.
|
@thomaseizinger you forgot to push the |
Generally I would prefer a merge over a cherry-pick. Though in this case, given that #4755 removes the deprecated items, I think it is fine as is. |
I didn't have one locally so I made one now :) |
I'll just manually update the changelog then. |
Whatever works best for you. I don't feel strongly here. Thank you! |
Description
We've already agreed that we want to remove this. There is no reason to not let our users know about this already through a deprecation. From the deprecation alone we can see how invasive this type parameter actually is, esp. compared to how little value it adds to the library.
Related: #3591.
Notes & open questions
Change checklist