-
I was looking for Connection Manager implementation that’s already available in go-libp2p but couldn’t find it in the rust-libp2p crate, any workarounds for this? Im trying to port over some go implementation of my custom protocol in rust |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
At the moment the only thing close would be the connection limiter. rust-libp2p does have a form of connection management by which any connections that are not marked with Ideally though, I would like to see this more in rust-libp2p and pretty sure that may come in due time. |
Beta Was this translation helpful? Give feedback.
-
I am not entirely sure how the connection manager in go-libp2p works, but there are a variety of ways of how you can control connections in rust-libp2p:
As @dariusc93 already mentioned, each protocol itself also defines how long it needs each connection to be alive. If all protocols say Hope this helps! Let us know if you think that a certain usecase isn't covered here and we'll see to accommodate it :) |
Beta Was this translation helpful? Give feedback.
At the moment the only thing close would be the connection limiter. rust-libp2p does have a form of connection management by which any connections that are not marked with
keepAlive::Yes
(or whenKeepAlive::Until
duration is up) would close after a specific amount of time, though this really varies since most protocols would compute such value to determine if it should be kept alive or not (this may change in the future though - see #4121, #4161, and #3844). You could make your own form of a connection manager behaviour by tracking activities from protocols emitting events and emitting some form of event back to the behaviour in which it would mark the connection based on different things…