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

feat(swarm): add ConnectionHandler::connection_keep_alive default implementation #4703

Closed

Conversation

leonzchang
Copy link
Contributor

@leonzchang leonzchang commented Oct 22, 2023

Description

Add ConnectionHandler::connection_keep_alive default implementation.

Related: #4306.

Notes & open questions

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@leonzchang leonzchang changed the title add connection_keep_alive default impl feat(swarm): add ConnectionHandler::connection_keep_alive default implementation Oct 22, 2023
@thomaseizinger
Copy link
Contributor

Great! This definitely needs a changelog entry and we need to adjust the docs as well to explain that this is optional.

@@ -125,25 +124,23 @@ pub trait ConnectionHandler: Send + 'static {

/// Returns until when the connection should be kept alive.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to completely overhaul this together with #4595. What do you think of merging this PR into #4595? It is so closely related, I think it makes sense to just merge it as a single-patch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, what do your think we also change KeepAlive to boolean in #4595

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, what do your think we also change KeepAlive to boolean in #4595

I think it makes sense. With only two variants, we don't really gain anything from having another type and I cannot see how somebody could misinterpret what true and false mean in this case.

@leonzchang leonzchang closed this Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants